Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
Hi.
I'm trying to clean up a sheet I have inherited from my predecessor.
It involves a very basic Dax formula that the company uses to calculate staff productivity:
Productivity =
DIVIDE(
| SUM('Employee_Hours'[Job_Hours]),
| SUM('Employee_Hours'[Hours_Rostered)
) + 1
The problem with this formula is that if an employee has registered zero hours, then their productivcity defaults to 100%. 0% would be the preferred default, if that is possible.
My dax skills are pretty basic that a solution immediately jumps out at me here - is there a better way to write this formula?
Solved! Go to Solution.
Hi @Jumper ,
Try to modify your formula like below:
Productivity =
IF(
SUM('Employee_Hours'[Hours_Rostered]) = 0,
0,
DIVIDE(
SUM('Employee_Hours'[Job_Hours]),
SUM('Employee_Hours'[Hours_Rostered])
)
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Jumper ,
Try to modify your formula like below:
Productivity =
IF(
SUM('Employee_Hours'[Hours_Rostered]) = 0,
0,
DIVIDE(
SUM('Employee_Hours'[Job_Hours]),
SUM('Employee_Hours'[Hours_Rostered])
)
)
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Brilliant - this works perfectly.
Thank you so much, and sorry for a slow reply (had a few days off!).
Here's a screenshot if that helps explain a little better:
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
14 | |
11 | |
8 | |
8 | |
8 |
User | Count |
---|---|
22 | |
13 | |
11 | |
10 | |
10 |