Oll*_*lly 12 dax ssas-tabular powerbi
我想基于维度值(或者实际上,基于度量值的数量级)动态地更改DAX度量的数字格式.
我明白我可以使用SWITCH和FORMAT,由卡斯帕·德容格在这里证明:https://www.kasperonbi.com/dynamic-format-using-dax/
这是我正在创建的度量类型的示例:
My Measure:=IF (
HASONEVALUE ( dimMeasureType[Measure Type] ),
SWITCH ( VALUES ( dimMeasureType[Measure Type] ),
"Total Cost", FORMAT ( [Total Cost], "#,##0, k" ),
"Cost Per Unit", FORMAT ( [Cost Per Unit], "#,##0.00" ),
"Cost % Sales", FORMAT ( [Cost % Sales], "0.00%" ),
BLANK()
),
BLANK()
)
Run Code Online (Sandbox Code Playgroud)
但是这种技术会返回文本度量.我需要能够绘制我的度量图表,所以我不想将它们转换为文本.是否有另一种技术可以动态更改度量数字格式,而无需转换为字符串?
如果它有所作为,我在SQL Server 2016 BI上使用SSAS-Tabular.
现在可以在 Power BI 中使用动态格式字符串实现这一点。
微软文档:https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-dynamic-format-strings
| 归档时间: |
|
| 查看次数: |
1138 次 |
| 最近记录: |