Forum Discussion
Measure Tool formatting - Dynamically change between Number and Percentage
Hi,
I have a measure to display Number / Percentage depending on user selection
NumberPercentage_Selection =
SWITCH(SELECTEDVALUE('Param_Table'[NumberPercentage Parameter], "Number"),
"Number", [NumberCalc],
"Percentage", [PercentageCalc]
)
I want to format the output accordingly, but the measure NumberPercentage_Selection can only have one format: Either Number or Percentage.
Any other trick to achieve this ?
Individually, my measure Number is in whole number format, and Percentage is in % format, and I have tried using General for my final measure.
Hi Anonymous ,
What you are considering is correct. general is the best solution.
Refer(configuration):
Output result:
Did I answer your question? Mark my post as a solution!
Best RegardsLucien
2 Replies
- selimovd
Most Valuable Professional
Hey Anonymous ,
that's right. In Power BI you can only give one formatting.
The only possibility to change the formatting dynamically is if you use a calculation group. There you have the possibility to also use a DAX function for the filter context.
Here is an article that describes how you can change the formatting dynamically. You could use the same SWITCH but return a different formatting string:
If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
Best regards
Denis
Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic - v-luwang-msft
Community Support
Hi Anonymous ,
What you are considering is correct. general is the best solution.
Refer(configuration):
Output result:
Did I answer your question? Mark my post as a solution!
Best RegardsLucien