Power Bi - Add thousands separator to cards

老子叫甜甜 提交于 2019-12-11 16:38:32

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!