问题
I have some DAX which adds the thousands separator to my card totals which I use in a measure:
Add Separator Measure =
VAR right =
RIGHT ( [Card Total Measure], 3 )
VAR left =
SUBSTITUTE ( [Card Total Measure] , right, "" )
RETURN
COMBINEVALUES ( ",", left, right )
Only drawback is that when the total is 0 it keeps the thousands separator before the total e.g. (,£0).
How can I add some logic that will remove the separator if the total is 0 to the existing dax?
回答1:
This is not a good way to format a number.
The easiest thing to do is to use formatting controls under the Modeling tab.
If that doesn't get you what you want, then the FORMAT function gives you more flexibility.
来源:https://stackoverflow.com/questions/53339560/power-bi-add-thousands-separator-to-cards