Forum Discussion
Format affects measure
Hi,
I have a measure with a switch function. In some cases it returns a percentage, in other cases it returns an absolute value. I used the FORMAT function in DAX to either return the result as a percentage or an absolute number.
This however means that the output is not a numeric value anymore, but a text value, as I have to add the '%' sign in the FORMAT function. I can therefore not use the output as an input for calculations in other measures, plus conditional formatting won't work.
I work with the PowerBI version from January 2022 which is installed on a server where no other tools can be installed, so Tabular Editor is not an option.
Does anyone have a good workaround for this? For conditional formatting I could create a duplicate of the measure without formatting, but the real problem is that I want to refer to this measure from other measures.
Best regards
Bas
2 Replies
- amitchandakSuper User
basrooz , In the measure tool or under data model -> property pane: give a format of your choice and try
https://docs.microsoft.com/en-us/power-bi/desktop-custom-format-strings
- basroozAdvocate I
amitchandak that won't work. You cannot change the format, it always reverts back to Text. Plus in that pane you can only select that it's either a percentage or an absolute number. I want the measure to dynamically switch between a percentage and an absolute number as an outcome.
Thanks
Bas