DAX Power BI:在连接期间尊重每个度量的单独格式

DAX Power BI: Respect the individual format of each measure during concatenation

我有 2 个度量要在尊重其原始格式的情况下连接起来。 最后一列应该是 % ticket type (numberDistinctCount).

例如 59.83% (168,479) 但是当我将它们结合起来时,格式似乎丢失并变成了 0.598337950138504 (168479)

我对最后一栏使用的定义是

% count ticket type = [% ticket type] & " (" & [numberDistinctCount] & ")"

有没有办法确保 2 个度量的串联符合单个度量格式?

此串联的结果将用作工具提示

谢谢

为此,您必须将您的度量值包装在 FORMAT 函数中,否则 Power BI 将默认为您的度量值输出的数字 - 在本例中为百分比格式“准备好”的小数。

试试这个:

% count ticket type = 
FORMAT ( [% ticket type] , "0.00%" ) & " (" & [numberDistinctCount] & ")"