Forum Discussion
Dynamically format a measure as $ or %
I used the switch function as below but the new measure is now formatted as a text and cannot be added to the visual.
CurrentValueFormatted = switch([DataTypeMeasure],"P",format([CurrentPercentValue],"Percentage"),"A",format(HotelKPICalculation[CurrentPercentValue],"Currency"))
It's true. Once you use Format() function, the data type will be converted to text, it will throw error if you change it to numeric type.
It's not possible to give a dynamic format on a measure but still keep numeric data type.
Regards,
- Anonymous7 years agoNot applicable
Hi! I'd very much like this to be suggested as a fix. We often want to be able to show dynamically formatted measures in graphs.
- Clara7 years ago
Advocate II
I've created an idea requesting that this be implemented. Please help vote it up! https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/35921176-option-to-format-values-as-numbers-not-strings