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
Hello All, I have a slicer that switches between dollars and units for a measure. Here is the Dax
Hi @Anonymous ,
Did I answer your question? Please mark my reply as solution, thank you~
Hi Unfortunetly it does not work still as it will not show up in a graph like a bar or line chart as it is presented as a string. Any ideas how to fix?
Hi @Anonymous ,
According to my understanding, you want to dynamically display the formatted value based on slicer, right?
Here are my data sample:
You could use the following formula:
Total Payments =
FORMAT ( SELECTEDVALUE ( Pay[Payment] ), "0,000" )Total Payment$ =
FORMAT ( SELECTEDVALUE ( Pay[Payment] ), "$0,000" )Payment Selection =
SWITCH (
SELECTEDVALUE ( 'MeasureType'[Units] ),
"Count", [Total Payments],
"Dollars", [Total Payment$]
)My visualization looks like this:
Is the result what you want? If you have any questions, please upload some data samples and expected output.
Please do mask sensitive data before uploading.
Best Regards,
Eyelyn Qin
Hi @Anonymous
use the external tool tabular editor. Take a look at the following link:
https://www.kasperonbi.com/dynamic-formatstrings-with-calculation-groups/
Regards FrankAT
see my update. This wont show up in a chart still.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |