Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Using calculation group, measures can be selectively replaced in a placeholder measure as explained in the article:
The requirement is not only to selectively replace the measure but replace the measure format as well.
The placeholder measure's format needs to be changed as per the measure being substituted e.g. decimal, whole, percentage etc.
The example taken for this requirement is bit contrived but the same solution can be applied to some other real world valid examples.
Steps:
1. Download the pbix file from https://www.sqlbi.com/articles/using-calculation-groups-to-selectively-replace-measures-in-dax-expre...
2. In report "F02", when PriceToUse = "Net Price", show the "Margin %" column with 3 decimals as below:
3. In report "F02", when PriceToUse = "Unit Price", show the "Margin %" column with 2 decimals as below:
Thanks.
Solved! Go to Solution.
I think the requirement can not be implemented.
The reason being "Format String Expressions" option is not available to regular measures, only available to calculation items.
Here [Margin %] being a regular measure, only static "format string" can be applied, not dynamically based on the calculation item selection using "Format String Expressions".
It would be a good feature addition, being able to apply dynamic formatting to regular measures using "Format String Expressions".
I think the requirement can not be implemented.
The reason being "Format String Expressions" option is not available to regular measures, only available to calculation items.
Here [Margin %] being a regular measure, only static "format string" can be applied, not dynamically based on the calculation item selection using "Format String Expressions".
It would be a good feature addition, being able to apply dynamic formatting to regular measures using "Format String Expressions".