Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi PBI Heroes
I need some help on a dynamic measure header display based on slicer selections.
Currently, my measure header is as follows by default (without slicer selection):
Total Sales
Total Cost
Total GP
But when my slicer of subsidiary is selected (for example ABC or XYZ), i need to measure header to change accordingly to below, depending on single selection. If multiple selections then default header applies.
Sales for ABC
Cost for ABC
GP for ABC
or
Sales for XYZ
Cost for XYZ
GP for XYZ
I have seem a few number of tutorials but mostly are dealing with dynamic column headers and I have no idea how to apply to measures. Bookmarks will not help as well since it might reverse selections of other slicers.
Many thanks in advance!
Cheers!
Regards
Shao
Hi @Anonymous ,
It seems to me that you have quite a lot of subsidiary and so you want the header to be dynamic and not hardcoded in a formula. You'll need to create every possible combinatin of subsidiary + measures in Power Query and then use DAX to return a value based on slicer selection. If so, please refer to the attached pbix. Sample result is as shown below:
Hi @danextian
Appreciate the suggestion.
The number of headers should remain as 3 columns (Sales, Cost, GP) with the header name changing according to the selection. In your example, if more than 1 subsidiary is selected, the header name should ideally reflect as the default (i.e Total Sales, Total Cost, Total GP). Same as when no selections are made.
What I need however, is when single selections are made, the header will change and reflect that selection.
Hi @Anonymous ,
Please try to use the SWITCH function with a variable that stores the slicer value. You can then use different cases to return different measure headers based on the slicer value. For example, if you have a slicer called Subsidiary with values ABC and XYZ, you can create a measure header like this:
MeasureHeader =
VAR _Subsidiary =
SELECTEDVALUE ( Subsidiary[Subsidiary] )
RETURN
SWITCH (
_Subsidiary,
"ABC", "Sales for ABC",
"XYZ", "Sales for XYZ",
"Total Sales"
)
You can then add this measure to your visual header and it will dynamically change based on the slicer selection.
How to Get Your Question Answered Quickly
If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .
Best Regards
Community Support Team _ Rongtie
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Rongtie
Thanks for the suggestion. However that is not exactly the result I am looking for. I am hoping the measure headers will change dynamically based on my selection but in your proposed solution, I will be stuck with a static header "MeasureHeader".
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 36 | |
| 34 | |
| 31 | |
| 27 |
| User | Count |
|---|---|
| 135 | |
| 103 | |
| 65 | |
| 61 | |
| 55 |