Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
I have a visual where I have created a slicer to switch between different measures. Some of the measures our percentages, dollars, and just decimal. I tried changing the format, but it won't change. How do I go about changing the format when using measures in a slicer so the format is reflected in the visual? Thanks.
Solved! Go to Solution.
hi @cheid_4838
In the slicer tabe, add a column that indicates the format string. For example
Measure Name | Format String |
Dollar Value | $#,# |
Percentage | 0.00% |
Volume | #,# |
Now, select the measure that switches between different measures. Go to format under the measure contextual tab. Click Dynamic from the dropdown.
Enter SELECTEDVALUE('slicer'[format string]) in the formula bar.
hi @cheid_4838
In the slicer tabe, add a column that indicates the format string. For example
Measure Name | Format String |
Dollar Value | $#,# |
Percentage | 0.00% |
Volume | #,# |
Now, select the measure that switches between different measures. Go to format under the measure contextual tab. Click Dynamic from the dropdown.
Enter SELECTEDVALUE('slicer'[format string]) in the formula bar.
Hi @cheid_4838
To dynamically change the format of your values based on the measure selected in your slicer, you can use a combination of SWITCH and a calculated DAX measure. While Power BI does not natively support dynamic format strings for measures in field parameters, you can simulate this by creating a measure for formatting your values.
Example DAX Measure
DAX
Copy code
FormattedMeasure =
VAR SelectedMeasure = SELECTEDVALUE('MeasureSelector'[MeasureName])
RETURN
SWITCH(
TRUE(),
SelectedMeasure = "Percentage Measure", FORMAT([YourPercentageMeasure], "0.00%"),
SelectedMeasure = "Currency Measure", FORMAT([YourCurrencyMeasure], "$#,##0.00"),
SelectedMeasure = "Decimal Measure", FORMAT([YourDecimalMeasure], "0.00"),
BLANK() // Default value if no measure is selected
)
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.
I created this measure and entered the FORMAT in the return statement, but I am getting an error message shown below. I even tried it with additional parenthesis and still didn't work. Is FORMAT in the wrong location within the measure?
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
73 | |
72 | |
39 | |
31 | |
26 |
User | Count |
---|---|
97 | |
87 | |
43 | |
40 | |
35 |