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
Fusilier2
Helper V
Helper V

Conditional number rounding

Can anybody recommend a solution to this:

I have monthly data values that will always be between 0% and 100% but never higher than 100%.

They are displayed in a visual with labels turned on. What I want to achieve for the data labels is, if the value is < 100% to display to 1 decimal point (e.g. 98.7%), but if the value = 100% to display with no decimal points )100%).

Is that possible? I presume by using a measure?

 

1 ACCEPTED SOLUTION
BITomS
Continued Contributor
Continued Contributor

Hi @Fusilier2 ,

 

FormattedPercent =
VAR BaseValue = SUM('Table'[PercentValue])
RETURN
IF(
BaseValue = 1,
FORMAT(BaseValue, "0%"),
FORMAT(BaseValue, "0.0%")
)

 

Hope this helps!

View solution in original post

3 REPLIES 3
BITomS
Continued Contributor
Continued Contributor

Hi @Fusilier2 ,

 

FormattedPercent =
VAR BaseValue = SUM('Table'[PercentValue])
RETURN
IF(
BaseValue = 1,
FORMAT(BaseValue, "0%"),
FORMAT(BaseValue, "0.0%")
)

 

Hope this helps!

123abc
Community Champion
Community Champion

Excellent ... Good solution 👍

Thank you for your help!

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

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