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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Divide by Zero error

Hi,

 

Here is my dax measure: AVG = CALCULATE(IF(
OR(ABS([Sales]) = 0, ABS([Pounds]) = 0),0,DIVIDE([Sales],[Pounds)))
I got correct answer for all columns but except one, it shows very small number(-6,219,471,085,398,656) after I using this measure, it should be showed as zero.
What is the issue with it?

 

jennifermemeda_0-1656687532575.png

 

1 ACCEPTED SOLUTION
SolomonovAnton
Super User
Super User

for except this error you should use ROUND

 

AVG = 
var _sales=Round([Sales],2)
var _pounds = Round([Pounds],2)

var _result = CALCULATE(IF(
OR(_sales = 0, _pounds  = 0),0,DIVIDE(_sales,_pounds ))

return _result

 

 

View solution in original post

5 REPLIES 5
PaulDBrown
Community Champion
Community Champion

Why the ABS?

if you want to check if the measure is 0 (not blank), use [Sales] == 0





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






SolomonovAnton
Super User
Super User

for except this error you should use ROUND

 

AVG = 
var _sales=Round([Sales],2)
var _pounds = Round([Pounds],2)

var _result = CALCULATE(IF(
OR(_sales = 0, _pounds  = 0),0,DIVIDE(_sales,_pounds ))

return _result

 

 

Anonymous
Not applicable

Thanks for the solution! I solved it

please mark this topic as solved 🙂

SolomonovAnton
Super User
Super User

hello 

 

it is mean what in [pounds] you have number 2.66E-14

another words it is not 0 it is very small number 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.