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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
ibrewop23
Frequent Visitor

Calculating Employee Average Hours per Month (using Weekly Hours)

I am attempting to calculate the average number of working hours per month per employee using their weekly hours against their job. 

 

1 employee can have multiple jobs active at any time. Each job has a weekly hour value, a job start and end date. The assumption is made that an employee works 7 days a week each month of the year from the start to the end date of their job.

 

Example Data:

ibrewop23_0-1674066730095.png

 

Employee 1 is not a problem. I can do the following (correct me if this is wrong):

VAR SOMcurrent = MIN ( 'DateTable'[Date] )
 
VAR EOMCurrent = MAX ( 'DateTable'[Date] )
 
VAR HoursPerWeek =
    CALCULATE (
        SUM ( 'Job'[Hours] ),
        FILTER (
            'Fact Job',
            'Fact Job'[StartDate] <= SOMcurrent 
                && 'Fact Job'[EndDate] >= EOMCurrent 
        )
    )
 
Hours Per Month = HoursPerWeek / 7 days * days in selected month

Employee 2 is tricker because their jobs don't start or end at the end of the month AND they're jobs have crossover, therefore their contract hours need summed and then averaged.
 
I have written a long dax statement using further calculates, date filtering by MONTH and YEAR. But I need to specifiy this to calculate at the employee level in the DAX. And I am a unsure as to how I can achieve this.
 
Thanks in advance.
1 REPLY 1
Villezekeviking
Most Valuable Professional
Most Valuable Professional

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors