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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
micklowe
Helper I
Helper I

Using the DIVIDE Function

Hi

I'm having a few problems with the NaN and Infinity errors on a calculation field, I believe the solution is to use the DIVIDE function but I'm having problems getting this to work. 

 

This is the current calculation:

Utilisation = CALCULATE([productive_time]/([WorkingHours]-[non_productive_time]))*100

 

Is it possible to rewrite this as a DIVIDE or do I need to create a new calculated field for "WorkingHours - non_productive_time?

 

Thanks for any help.

Mick

1 ACCEPTED SOLUTION
HarishKM
Solution Sage
Solution Sage

@micklowe Hey,
you can write your dax like this.
Utilisation = 
Var _a = [productive_time]
VAR _b=( [WorkingHours]-[non_productive_time])

return

 = divide(_a,_b,0)*100


you can try above dax.

Thanks

Harish M

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

2 REPLIES 2
micklowe
Helper I
Helper I

Thanks Harish, this worked perfectly, I did have to remove the equals sign to get it to work but the divide by zero errors are now gone 🙂

 

Final code looks like this:

 

Utilisation = 
Var _a = [productive_time]
VAR _b=( [WorkingHours]-[non_productive_time])

return

divide(_a,_b,0)*100

 

 

HarishKM
Solution Sage
Solution Sage

@micklowe Hey,
you can write your dax like this.
Utilisation = 
Var _a = [productive_time]
VAR _b=( [WorkingHours]-[non_productive_time])

return

 = divide(_a,_b,0)*100


you can try above dax.

Thanks

Harish M

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

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.