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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
AppleMan
Helper III
Helper III

Overtime Report Help

Hi,

 

I need some help designing the best way to make an overtime report work.

 

Right now, I have a table that has every labor entry employees have made. The important columns are:
Employee number, date, and hours (among some others).

 

I need to find a way to show overtime hours (which for this question lets just say is anything over 40 hours in a week, other tweaks will need to be made but I will figure out that problem as I go). 

 

What is the best way to sum hours by week and find when an employee id who may have 20 entries that need to be summed in any given week, is over the 40 hour threshhold?

 

I can give further criteria and information as needed, just need a hand figuring out the best logic to handle what I need. 

Thanks!

1 ACCEPTED SOLUTION

@AppleMan ,

Various ways this can be done.  I have attached an updated pbix that shows one of these ways.

Import your Holiday Table.  Connect it to your Date Table.  It should be 1-1 relationship.

Then I created a Calculated Column in your Date Table using SWITCH and LOOKUPVALUE.

I structured it to give you 0's and 1's, but you can replace these with other values if you so choose ("Holiday" or "Work Day").

Let me know if you run into any issues....

Regards and Good Luck

View solution in original post

31 REPLIES 31

@AppleMan ,

Change "COUNT" to "COUNTA".  This is how DAX counts text values.

I suggest to change your Condition from "=1" to ">=1"  to take into account weeks having more than 1 holiday unless you are absolutely sure there is no week having more than 1 holiday

Hope this works!

You can ignore my last response, I realized the fault in my logic is it is counting the text field and since the "0"'s are considered text it was always above 0. I added a clause in the calculate function to exclude any lines that have a holiday of "0".

I planned to change it to >=1 for just that reason, but COUNTA partially did it! I knew thats how that worked too.. cant you tell its Monday.

The issue im seeing is this calculated column is throwing a 1 for every single row currently.

AppleMan_0-1707773695200.png

 

Only days/weeks with holidays:

AppleMan_1-1707764877894.png

 

Column calculation for verification:

AppleMan_0-1707765523105.png

 

 

 

 

 

@AppleMan ,

In your Calculated Column [Holiday] column, change "0" to Blank().

rsbin_0-1707767855698.png

PBI is reading your "0" text value and counting it as 1.

 

I apologize for bombarding you with a million questions, but I have another one if you dont mind helping.

 

I set up that field we spoke about previously in the date table to give the number of holidays in that week, or 0 if none, like below:

AppleMan_0-1707772857101.png

 

I have decided to tally all overtime in seperate summarized tables so that I can just sum the columns necessary. What I need to do is have the overtime threshold adjust itself properly based on holiday number in that week, so week 317 would have a threshhold of 24 (40 - (2 holidays * 8)), and week 319 should have a threshhold of 32 respectively. 

 

What is the best way to write this dax formula to adjust according to what week the data falls in?

AppleMan_1-1707773030903.png

Overall table structure in case its helpful:

AppleMan_2-1707773052703.png

 

 

@AppleMan ,

Does this work for you?

Threshold = 40 - 
            ( 8 * LOOKUPVALUE( TestDate[HolidayWeek], TestDate[FullWeeknum], [FullWeeknum] ))

FullWeeknumHoursThreshold

317 41 32
319 5 24

My test data as follows:  Week 317 has 1 holiday, Week 319 has 2 holidays.

Regards,

What is the final variable '[fullweeknum]' in reference to? 

I am not able to try this formula as its typed. I can enter everything as you show except that last variable to test it. 

@AppleMan ,

Column Name from my dummy table:  TestThreshold[FullWeekNum]

rsbin_0-1707843375774.png

 

I found my issue, I still had the whole function wrapped in calculate. I removed that and this seems to work how I want! Thank you! 

Yeah thats how I ended up doing it. Have a few more kinks to work out to get this working properly with a holiday schedule table I have to change the overtime threshhold, but all in all its coming together well. 

I will for sure let you know if I run into any further questions! I should have the data manipulated how I want from here, just need to make sure my measures function how I expect as I get the visuals thrown together. 

Again, appreciate the help!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors