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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
AltusTellus
Helper III
Helper III

Calculate working hours without and with end date

Hi all,

 

I have some troubles calculating the capacity of working hours per employee in the future but also in the past. The case is:

 

One employee has a schedule from 01.01.2021 until 31.03.2021 with a average of 32 hours per week. The same employee has a successive schedule from 01-04-2021 with a average of 40 hours per week. The end date is still unknown, but could be be filled in the future.

 

My table is:

EmployeeIDEmploymentIDStartDateEndDateAverageHoursWeek
50090001.01.202131.01.202132
50090101.04.2021 40

 

And off course I have a dimdate table connected.

 

What I want to report is that p.e. at 04.01.2021 the employee works 6,4 hours (32 hours divided by 5 working days). The same for p.e. 02.04.2021 but then 8 hours. Example:

 

04.01.20216,4
05.01.20216,4
... 
01.04.20218
02.04.20218
et cetera8

 

So I always need to report the average working hours with a reference date. Please give me a direction to come to the right calculation. In advance many thnx!

1 ACCEPTED SOLUTION

Use COALESCE to substitute potential blank values with the maximum date you want to use, for example 2021-12-31.

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

First step is to define what you mean by week.  Are all employees in the same time zone? Same country? Saturday half days?

 

Then you use GENERATESERIES to compute the daily work time as you describe, and then you create the measure for the cumulative total.

Hi @lbendlin , all employees ar working in the same timezone and same country. And yes, I would like to except the weekend days, but that is the finishing touch 🙂

 

GENERATESERIES is not allowed with blank values, in my case the end date is sometimes blank. To be clear: an employee works 40 hours every week. How do I get this in a matrix for p.e. the year 2021, depending on if the employee still has an active employment? Can you help me further on? Many thnx!

Use COALESCE to substitute potential blank values with the maximum date you want to use, for example 2021-12-31.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors