Forum Discussion
lucia_t
4 years agoNew Member
DYNAMIC FORMATTING OF SWITCH MEASURES
I'm using SWITCH function to select between different measures:
Measure = SWITCH(Customers[SelectedKPI],
1,SUM(Customers[Average Subscribers]),
2,-SUM(Customers[Deactivations])/SUM(Customers[AverageSubscribers]),
3,SUM(Revenues[Revenues]),
4,SUM(Revenues[Revenues])/SUM(Customers[Average Subscribers]))
I'd like to use different formatting types, but when I use FORMAT function it converts the numbers to text and it does not allow me to put the measures into my charts. Is there any workaround?
This is how I'd like them to be displayed:
1 - display in thousands
2 - percentage with 2 decimal places
3 - display in millions
4 - decimal number
Thank you!
1 Reply
- AlexisOlson
Super User
This is a popular idea but I don't think there's currently a solution straight out of the box.
A workaround involves calculation groups. Check these prior posts for more detail:
https://community.powerbi.com/t5/Desktop/Dynamic-formatting-of-measures-tutorial/m-p/1297373
https://community.powerbi.com/t5/Desktop/Dynamic-Formatting-of-Measure/m-p/2331509
https://community.powerbi.com/t5/Desktop/Custom-Format-String-based-on-measure-value/m-p/2281002