Forum Discussion
Dynamic Formatting with DirectLake Semantic Model
- 1 year ago
Hi ryan0585 ,
Sorruy I should have check this sooner but the dynamic format strigs are not available for Report Measures not only for Direct Lake but for all semantic models in the service:
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-dynamic-format-strings
Yeah so the second bullet there. We'd like to use the switch statement to evaluate the user's metric selection, then return a measure value in the appropriate format. Some sample DAX here we're using in the semantic model for the Format = "Dynamic" selection. Unfortunately, we just can't take this same approach ATM in a local .pbix file connected to that semantic model.
VAR SelMeasure = SELECTEDVALUE('metric'[metric_id])
RETURN
SWITCH(
SelMeasure,
16, "#,0;-#,0;#,0",
18, "#,0;-#,0;#,0",
2, "0.0%;-0.0%;0.0%",
3, "0.0%;-0.0%;0.0%",
4, "0.0%;-0.0%;0.0%",
5, "#,0;-#,0;#,0",
47, "#,0;-#,0;#,0",
6, "0.0%;-0.0%;0.0%",
7, "0.0%;-0.0%;0.0%",
8, "0.0%;-0.0%;0.0%"
)
Hi ryan0585 ,
Sorruy I should have check this sooner but the dynamic format strigs are not available for Report Measures not only for Direct Lake but for all semantic models in the service:
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-dynamic-format-strings