Power Bi-为卡片添加数千个分隔符 [英] Power Bi - Add thousands separator to cards

查看:713
本文介绍了Power Bi-为卡片添加数千个分隔符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一些DAX,它将成千上万个分隔符添加到我在衡量中使用的卡总数中:

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 )

唯一的缺点是当total为0,它将千位分隔符保留在总数之前,例如(,£0)。

Only drawback is that when the total is 0 it keeps the thousands separator before the total e.g. (,£0).

如果现有dax的总数为0,如何添加一些逻辑以删除分隔符?

How can I add some logic that will remove the separator if the total is 0 to the existing dax?

推荐答案

这不是格式化数字的好方法。

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.

这篇关于Power Bi-为卡片添加数千个分隔符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆