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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
erihsehc
Helper III
Helper III

number formating issue

hi there,

 

I would like the number format in %, however, when I used formula ratio% = IFERROR(SUM(Sheet1[sales])/SUM(Sheet1[cost]),"na"), the result cannot be formatted in %, how to solve this? thanks

 

ratio format.JPG

 

data model is as below

data model

 

Best regards,

ER

 

1 ACCEPTED SOLUTION

Hi @erihsehc

 

This could possibly done by using the Format as shown below.

My Measure =
IF (
    [Net Win] > 100,
    "nm",
    FORMAT ( DIVIDE ( SUM('Table1'[sales]), SUM('Table1'[Other Sales]), "NA" ), "Percent" )
)




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

Proud to be a Super User!







Power BI Blog

View solution in original post

8 REPLIES 8
GilbertQ
Super User
Super User

Hi @erihsehc

 

What I would suggest doing is to use the new Divide Function which caters for Divide by Errors.


So your measure could be written as:

My Measure = DIVIDE(SUM(Sheet1[sales]),SUM(Sheet1[cost]))

This will result in the Divide by errors being blank





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

Proud to be a Super User!







Power BI Blog

thanks @GilbertQ, got it. However, we would like to show "na" (also exclude some extreme number by using if(>100,"nm") ) instead of blank for presentation. is that any method to show text but also format the number as %?

Hi @erihsehc

 

This could possibly done by using the Format as shown below.

My Measure =
IF (
    [Net Win] > 100,
    "nm",
    FORMAT ( DIVIDE ( SUM('Table1'[sales]), SUM('Table1'[Other Sales]), "NA" ), "Percent" )
)




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

Proud to be a Super User!







Power BI Blog

thanks @GilbertQ, this formula is working but there is another issue that, when I put this measure to a multi-row card, I can not format this %result, ("-1.28%" on the screenshot used this measure), I can not add label for it, and this % always stay on top, can not format the color and size.

format.JPG

Hi @erihsehc,

As @GilbertQ posted, there is no way to format the measure. Please mark the solution @GilbertQ shared as answer because it resolve your issue. So that more people will get useful/helpful reply as answer.

Best Regards,
Angelia

ok thanks for the helpMan Happy

Hi @erihsehc

 

Unfortunately there currently is no other way to format the measures so that they can change based on different scenario's.

 

I would suggest going to https://ideas.powerbi.com and voting for the idea.





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

Proud to be a Super User!







Power BI Blog

Anonymous
Not applicable

Could you consider a 2nd Formatting Measure for your cards?  Something like

Formatted = Var MeasureResult = [YourMeasure]
RETURN
IF(
     MeasureResult = "na",
     "NA",
     (MeasureResult * 100) & "%"
)
      

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.