The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Dear Community,
I need your help figuring out how to calculculate daily overtime hours.
1. Overime hours are hours exceeding 40 regular hours a week.
2. To find cumulative hours I used:
Solved! Go to Solution.
I came up with the following DAX:
Hi,
Share some data to work with and show the expected result clearly.
Thank you for your help!
Daily overtime is calculated after reaching over 40 regular hours a week
BUT there is a problem - overtime hours are shown accumulated and I need to show them per day.
This is confusing to me. Can you please elaborate?
Employees work full week (Sunday - Saturday). All hours are overtime once they reach 40 hours of regular time. So, they get usually get overtime hours on Thursdays, Fridays, Saturdays. I need to show regular and overtime hours like this:
Thanks again for helping me with this problem. I really appreciate it.
Please correct your statement for point 4.
Thanks for pointing it out. I corrected it. Thanks for your help!
Your SUMX has to go over the individual days in the filter context. To make it more obvious you can use SUMMARIZE first
SUMMARIZE (table, days, "hours worked",<hours worked>,"overtime", if <hours worked>>8, <hours worked>-8)
and then do a SUMX over <overtime>
The problem is that I cannot deduct 8 hours from total daily worked hours. Daily overtime is calculated after reaching over 40 regular hours a week. So, overtime hours would occur by the end of week only.
I came up with the following DAX:
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
80 | |
71 | |
51 | |
50 |
User | Count |
---|---|
123 | |
119 | |
76 | |
64 | |
60 |