Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

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 measures, and I want to be able to rename them dynamically. Please See the screenshot below, where I have hardcoded the column names but I want them to be dynamic.

 

jay5300_0-1595574655110.png

 

say my DAX reads

YEARNUMBER=YEAR("March 3, 2020 3:45 PM") and the result is 2020 and i want the measure name to be 2020 INSTEAD of YEARNUMBER.

 

Any help is really appreciated.

2 ACCEPTED SOLUTIONS
Smauro
Solution Sage
Solution Sage

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.



Feel free to connect with me:
LinkedIn

View solution in original post

dax
Community Support
Community Support

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.

View solution in original post

3 REPLIES 3
dax
Community Support
Community Support

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.

Smauro
Solution Sage
Solution Sage

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.



Feel free to connect with me:
LinkedIn

Fowmy
Super User
Super User

@Anonymous 

I am not sure if It is possible to do so but, you can create a measure that shows all the years selected and show in a card visual above the table or use the Visual Title to include the dynamically selected values using Conditional Formatting.

________________________

Did I answer your question? Mark this post as a solution, this will help others!.

I accept KUDOS 🙂

YouTube, LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.