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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Rosenmeyer
Frequent Visitor

Calculating actual work hours

Hi community 

 

I currently have a dataset of two times between when a case was opened and when a case was closed. I want to filter out hours outside of our business hours (We work 8:00-16:00) and apart from that I also want weekend days (Saturday/Sunday) to be filtered out. So the idea is that it calculates a column wherein it shows only the hours where we have been at work between the two dates of Case_created and Case_closed.

 

Case_createdCase_closed
01-10-2018 10:37:4502-10-2018 10:49:54
01-10-2018 10:49:5202-10-2018 08:39:51
01-10-2018 12:10:1102-10-2018 08:54:47
01-10-2018 13:47:2001-10-2018 13:54:35
01-10-2018 14:32:1203-10-2018 09:44:03
01-10-2018 14:34:2209-10-2018 12:02:02

 

This is what a sample of the dataset looks like, any help?

2 REPLIES 2
judspud
Solution Supplier
Solution Supplier

Hi @Rosenmeyer 

 

This would be quite a complex statement to write if i understand your question correctly.

 

My approach would be a series of IF statements to check the time and date at which the case was created and the time and date at which the case was closed. You can use this to sum the full days in between (numbers of days * 10) and work out the hours on the start and end date. 

 

My approach for the sat/sun days would be to link the table to a date table that has a column identifying a working day.

 

You can then use a filter to only sum those days where they are identified as a working day.

 

I hope this helps.

 

Thanks,

George

 

 

Thank you for your input, I appreciate it.

 

Yeah, I am quite new to Power BI and DAX, so it's not really in my capabilities yet, I was curious if there was an easier way to go about it. Maybe I'll have a go at fiddling about with some IF statements.

 

 

 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.