Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Dynamic Column Names in a table visual for a measure

Hello Everyone,   I am new to PBI and am having trouble in getting the below done.   Want to dynamically name the measure name from the output of the calculation. I have table visual with 5 meas...
  • Smauro's avatar
    6 years ago
    Hi Anonymous, what you're asking is not possible. A measure's (or calculated column's, or column's) name is a constant text, existing in the json which defines everything available in the tabular model.

    What you can do though, is create just one measure which will also take into account the selected year, and use a matrix visual, adding 'Year' in columns.
  • dax's avatar
    6 years ago

    Hi  Anonymous ļ¼Œ 

    As mentioned above, when you put data in Table visual, the field name will be the table column header name. It can't be changed dynamically, you could submit this in ideas . 

    If you want to column show it based on date, you could chage your data structure(power query , unpivoy your data) like below(put name in Row, year in Column, amoun in Value in Matrix, then column name is 2018, 2019, 2020)

    name year amout

    a 2020 2
    a 2019 3
    a 2018 5
    b 2020 2
    b 2019 6
    b 2018 3

    If possible could you please inform me more detailed information(such as your expected output and your sample data )? Then I will help you more correctly.

    Please do mask sensitive data before uploading.

    Thanks for your understanding and support.
    Best Regards,
    Zoe Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.