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

View all the Fabric Data Days sessions on demand. View schedule

Reply
FBu_Gavin
New Member

Dynamic Label in the Table for Measure based on Selected Date

Hi everyone,

I’ve simplified my question using the example below (see image).

FBu_Gavin_1-1762909483040.png

 

I have a dataset showing Stock on Hand (SOH) by date and by product. In Power BI, I’d like to build a table (bottom section) where a dropdown slicer lets the user select the current date.

When a date is selected:

  • The table should show Current SOH for that date, and the column label should dynamically update to display the selected date.

  • The second column should show SOH for the previous day (selected date - 1), and its label should also update to reflect that date.

Essentially, I’m trying to create dynamic column headers that display the date values used in the calculation.

I previously used Qlik, which has a feature that allows users to define both a measure and its label expression. I’m looking for a similar capability in Power BI.

Any guidance or examples on how to achieve this in Power BI would be greatly appreciated.

Thanks,
Gavin

1 ACCEPTED SOLUTION
danextian
Super User
Super User

Hi @FBu_Gavin 

 

Power BI doesn't currently support dynamic column headers. You can either superimpose a card on the column headers or use a disconnected table containing a column that has all the possible combinations of  the date (formatted as text - dd/mm/yy, etc ) and your metric name and use a measure to determine which column values to return.

danextian_0-1762917697749.gif

Please see the attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
danextian
Super User
Super User

Hi @FBu_Gavin 

 

Power BI doesn't currently support dynamic column headers. You can either superimpose a card on the column headers or use a disconnected table containing a column that has all the possible combinations of  the date (formatted as text - dd/mm/yy, etc ) and your metric name and use a measure to determine which column values to return.

danextian_0-1762917697749.gif

Please see the attached sample pbix.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Thanks for the PBIX file! I’m currently using a card placed above the header, but your disconnected table approach gives me an alternative way to look at this issue.

Cheers

xifeng_L
Super User
Super User

Hi @FBu_Gavin 

 

In PowerBI, column labels of matrices cannot dynamically return specified values.

 

But you can create an auxiliary table to store the values of all possible column labels, and then use the feature of auto hiding the corresponding column when the matrix column is empty to achieve the goal.

 

 

 

Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !

 

Thank you~

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors