Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Saniat
Helper V
Helper V

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.

Saniat_0-1656571016920.png

 

1 ACCEPTED SOLUTION
v-luwang-msft
Community Support
Community Support

Hi @Saniat ,

What you are considering is correct. general is the best solution.

Refer(configuration):

vluwangmsft_0-1657097519580.png

 

Output result:

vluwangmsft_1-1657097543212.pngvluwangmsft_2-1657097550953.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

View solution in original post

2 REPLIES 2
v-luwang-msft
Community Support
Community Support

Hi @Saniat ,

What you are considering is correct. general is the best solution.

Refer(configuration):

vluwangmsft_0-1657097519580.png

 

Output result:

vluwangmsft_1-1657097543212.pngvluwangmsft_2-1657097550953.png

Did I answer your question? Mark my post as a solution!


Best Regards

Lucien

selimovd
Super User
Super User

Hey @Saniat ,

 

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:

https://whatthefact.bi/power-bi/data-model/change-formatting-of-each-individual-value-dynamically-wi...

 

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.