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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Ikezaki
Frequent Visitor

Divide function with inifity result issue

Hi guys,

 

I have been facing the Infinity issue when I have to divide by 0. This is the scenario, I have two columns one Original Qty and another one Updated Qty. I need to divide these two columns to get a percentage.

Right now I have the following expression:

=1 - Value.Divide (Number.Abs (Updated Qty), (Original Qty))

With this expression I am getting the infinity error message when the Original qty is 0. At least thats what I think the issue is.

Have you guys met this issue with the divide function before?

 

Thank you in advance,

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @Ikezaki 
To solve this issue with pq you can use an if statement like :

Ritaf1983_0-1707497880146.png

Dax dive function knows to deal with zeroes automatically 

Ritaf1983_1-1707497961483.png

pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

5 REPLIES 5
Ritaf1983
Super User
Super User

Hi @Ikezaki 
To solve this issue with pq you can use an if statement like :

Ritaf1983_0-1707497880146.png

Dax dive function knows to deal with zeroes automatically 

Ritaf1983_1-1707497961483.png

pbix is attached
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi @Ritaf1983  thank you for you reply.

 

I was testing the solution but for some reason I cant use it, please see the print below:

Ikezaki_0-1707499825805.png

Am I doing something wrong?

 

What is the error message?
Try this formula on my sample and share the link to the pbix...

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Found the reason, I had the IF capitalize. Thats a dumb error 

Thank you

I cant Press OK. You can see the red line or the red square on the box, meaning the syntax its not correct or not accepted?

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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