Calculating Over-Time Hours

SimonNU

Board Regular
Joined
Jul 11, 2013
Messages
140
I'm trying to calculate a measure that will return weekly over-time. Assuming overtime is 50 hours per week, how would I do it using the below model?

Fct_Hours:
Date_Key | Hours

Dim_Date:
Date_Key | Date | Month | Year | WeekOfYear (e.g. "Week 3, 2015") | etc..


Essentially, I'd like the Sum of Hours - Over Time Hours but only where that week's total hours is greater than 50.


Thanks!
 

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying
A measure like this should do the trick:

Code:
=
SUMX (
    VALUES ( Dim_Date[WeekOfYear] ),
    IF (
        CALCULATE ( SUM ( Fct_Hours[Hours] ) ) > 50,
        CALCULATE ( SUM ( Fct_Hours[Hours] ) ) - 50
    )
)
 
Upvote 0
Great, thanks Ozeroth!

For anyone reading this, I've expanded on Ozeroth's solution to develop an over-time calculation on a weekly and employee level, i.e. sum hours over 50 for each employee and for each week. This one is more likely to be encountered:

Code:
Overtime Hours :=
SUMX (
    VALUES ( Dim_Date[WeekOfYear] ),
    SUMX (
        VALUES ( Fct_Hours[Employee Name] ),
        IF (
            CALCULATE ( SUM ( Fct_Hours[Hours] ) ) > 50,
            CALCULATE ( SUM ( Fct_Hours[Hours] ) ) - 50
        )
    )
)
 
Upvote 0

Forum statistics

Threads
1,224,115
Messages
6,176,467
Members
452,728
Latest member
mihael546

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top