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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ukare1996
Helper I
Helper I

How to return zeros as percentage in power bi

Hi,
I am trying to work out a percentage. I need the below measure to return "n/a" if P1 Total is blank or (0) but to return 0.00% if the P1 Total has a value. How can I achieve.
Currently, it's just returning me 0.00% for everything with P1 Total > 1 >>> the calculation is just not working.
 
 
P1 Complete % =
IF(ISBLANK([P1 Total]), "n/a",
     IF([P1 Total] > 1, "0.00%",
          [Complete P1]/[P1 Total]
     )
)

 

// If P1 Total is blank I want it to return "n/a"
// If P1 Total is greater than 1 I want it to return 0.00%

Any help would be much apprecaited.
Thanks in advance
2 REPLIES 2
Mahesh0016
Super User
Super User

@ukare1996 

Total Sales = SUM('Table A'[Sales])
*********************************************
Sale of % =
DIVIDE (
[Total Sales],
CALCULATE ( [Total Sales], ALLSELECTED ( 'Table A'[Product], 'Table A'[Year] ) )
)
***********************************************************
Conditional % =
IF ( [Sale of %] = BLANK (), "N/A", 0 )

Mahesh0016_1-1684141617736.png

 

 

@ukare1996 Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Happy to help!!

ukare1996
Helper I
Helper I

I meant to say, it's currently just returning me n/a's for anything that has blank p1 total and for the ones greater than 1 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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