Dynamic Label in the Table for Measure based on Selected Date
Hi everyone,
I’ve simplified my question using the example below (see image).
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
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.
Please see the attached sample pbix.