Forum Discussion

lucia_t's avatar
lucia_t
New Member
4 years ago

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