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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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
Memorable Member
Memorable Member

@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
Memorable Member
Memorable Member

@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
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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