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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Anonymous
Not applicable

Calculating Overtime

I've done some research within the forum to look for the same question but couldn't find it. Please let me know if I've missed it though...

 

Anyways, I have these 2 tables, one with work hour each day. One is the date table. The relationship 'Hour'[EventDate] = 'DateTable'[Date] is created (many to one).

Hour table.PNGDate table.PNG

The mission is to calculate the WeeklyOvertime by summing all the hours each week and then minus 40 (Not minus 8 from each working day). Anything over 40hrs a week is considered Overtime.

 

I used matrix visualization. Collum is Week from 'DateTable' and Row is Person's names. Values is WeeklyOvertime (below)

I've tried the following function but so far no luck. 

 

WeeklyOvertime =

CALCULATE (

          SUM ('Hour'[Recorded hour];

          FILTER (

                  'Hour', 'Hour'[EventDate] <=MAX ('DateTable'[Date]))

          );

          FILTER (

                  'Hour', 'Hour'[EventDate] >=MIN ('DateTable'[Date]))

) - 40

 

Thank you in advanced for any suggestion you might have!

 

1 REPLY 1
Phil_Seamark
Microsoft Employee
Microsoft Employee

Are you just after the amount over for each person for each week?

 

if so this might be close

 

Weekly Overtime = 
VAR 
	Overtime = SUM('Hour'[Recorded Hour])
VAR 
	ReturnValue = if(Overtime<> blank(),CALCULATE(Overtime) - 40,Blank())
RETURN 
	ReturnValue

overimte.png

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.