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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Ranga
Regular Visitor

Daily percentage computation is giving wrong result

Hi,

I am trying to compute approved rate for the below sample data, my grand total approved rate may result to zero per line, I’m putting condition to keep blank() else I get NAN for %.
So I finally I get the below rate 5/12 = 4.16, but I getting wrongly as 3.16.

 

MonthlyAggregation.PNG

9 REPLIES 9
MattAllington
Community Champion
Community Champion

What is your formula?  I would try this

 

=divide(sum(table[approved count]),countrows(table))

 

from what I can see, there are only 11 records, meaning it should be 5/11



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Grand Total Count = Approved count + Rejected count, Which comes to 12 and SUM is not working.

What is the formula for "approved rate"?



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Approved Rate = Approved Count/Gran total. There's no option to send attachement, So i can send sample data and pbix. If u try with the data in the screen shot u can repro the same as well.

You will need to share the dax formulas if I am to try to help. Can you please cut and paste exactly what you have from the formula bar.  It seems you have 3 or 4 formulas. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

 

Hi,

 

 Here's the two formulas used and screen shot shows the fileds used, I have condtion if approved count = 0 keep it blank, you can see sample data will have blank , to avoid NAN. Hope this helps.

 

Grand Total = Sheet1[Approved Count] + Sheet1[Reject Count]
Approved Rate = IF(Sheet1[Approved Count] = 0,BLANK() ,DIVIDE(Sheet1[Approved Count],Sheet1[Grand Total]))

 

Chart Fields.PNG

 

 

It looks to me like your if statement is removing the rows with 0 an dhence they are not included in the calculation. 

 

Try this

 

Approved Rate = DIVIDE([Approved Count],[Grand Total])

 

Divide will handle the divide by zero case automatically. You should not use the table name in front of the measure name in your formula (best practice).  



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

I have tried this before and gives the same result.

I just did it and it worked fine.  Maybe try again, or post your workbook



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors