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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Pinky0404
Helper III
Helper III

NaN Error

Hi All,

 

I  have two columns , "Total Queries" & "Other blocked" and when i try to divide Other blocked / Total Queries is throwing NaN value when both columns has value 0. Hence unable to calculate the percentage for the same. Could anyone please help me with the NaN error .

 

Attaching sample where %  column should  actually result in 0.18 value  instead of  0.71

Sample 2018.PNG

 

 

Thanks in Advance !!

Pinky

1 ACCEPTED SOLUTION

Hi @Pinky0404,

 

Glad to hear that you have resolved your problem. Would you please kindly mark your sharing solution as an answer so that it can benefit more users?

 

Thanks,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Smauro
Solution Sage
Solution Sage

Hey there @Pinky0404!

You would probably be best with using the [b]DIVIDE[/b] function ( https://msdn.microsoft.com/en-us/library/jj677276.aspx ) where you could right something like:

P% = DIVIDE([Other Blocked], [Total Queries], 0)

Where you'd see a 0 in case [Total Queries] = 0. You simply then format the measure as a percentage in Modeling.

 

More, I see that you have [Other blocked] as a decimal, which I guess is redundant. I'd change it to whole number, you never know if DAX has any problems with dividing different types.

 

Hope this helps! 🙂




Spyros Mavroforos

Data Consultant


Find me on LinkedIn or drop me an email

eSpyros

Thanks for your response. I found an answer. i was directly dividing the columns  which was giving  the total % , rather calculating as sum(other blocked)/sum(total queries).

Hi @Pinky0404,

 

Glad to hear that you have resolved your problem. Would you please kindly mark your sharing solution as an answer so that it can benefit more users?

 

Thanks,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.