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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Anonymous
Not applicable

total hours worked in last year

I have an employee dataset just under 2000 rows that includes the following fields: 

 

EMP Numstart dateEnd dateExpected Hours
#11/01/202130/06/202138
#21/03/2021 25
#31/01/2019 40

 

i want to calculate the total expected hours in the last year for the full workforce and am having difficulty working out how to do this.  I'm not sure if i Should try and do this as a measure or calculated column.

 

I come from an excel background so i would normally step out in columns like so:  

 

HrsPerDay = Expected Hours / 5

StartCalcDate = Max of start date and date 1 year ago. 

EndCalcDate = Min of End date and today (or today if blank)

Eligibledays = networkdays between StartCalcDate & EndCalcDate 

workhours = Eligibledays * HPD

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , refer this HR blog in current employee use per day hours and sum it for total hour

 

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

 

example

Total Hour = CALCULATE(Sumx(FILTER(Employee,Employee[Start Date]<=max('Date'[Date]) && (ISBLANK(Employee[End Date]) || Employee[End Date]>max('Date'[Date]))),(Employee[hour per day ])),CROSSFILTER(Employee[Start Date],'Date'[Date],None))
Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , refer this HR blog in current employee use per day hours and sum it for total hour

 

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-trend/ba-p/882970

 

example

Total Hour = CALCULATE(Sumx(FILTER(Employee,Employee[Start Date]<=max('Date'[Date]) && (ISBLANK(Employee[End Date]) || Employee[End Date]>max('Date'[Date]))),(Employee[hour per day ])),CROSSFILTER(Employee[Start Date],'Date'[Date],None))
Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

thanks, exactly what i was after 🙂

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.