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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
jbenson
Helper III
Helper III

Hours Worked

I am looking for a formula to figure out how many hours an employee worked worked per day i have a date column, a start time column and an end time column my time columns show hours and minutes and if its am or pm. Not sure what formula to use to find hours per day 

1 ACCEPTED SOLUTION
rohit_singh
Solution Sage
Solution Sage

Hello @jbenson ,

In power query, you can use the function Duration.Hours() to find the time difference in hours between two given times. Sample is below :

rohit_singh_0-1652306043772.png

In DAX, you can  compute the difference between start and end times and then pass that in the DATEDIFF function to get the hours worked. Since there is no date part when you subtract the times, Power BI defaults to 30/12/1899 as the date, which is why I've subtracted the time difference from 30/12/1899 midnight to get the hours value.

rohit_singh_1-1652306288622.png

 

Kind regards,

Rohit


Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos!😊

View solution in original post

3 REPLIES 3
rohit_singh
Solution Sage
Solution Sage

Hello @jbenson ,

In power query, you can use the function Duration.Hours() to find the time difference in hours between two given times. Sample is below :

rohit_singh_0-1652306043772.png

In DAX, you can  compute the difference between start and end times and then pass that in the DATEDIFF function to get the hours worked. Since there is no date part when you subtract the times, Power BI defaults to 30/12/1899 as the date, which is why I've subtracted the time difference from 30/12/1899 midnight to get the hours value.

rohit_singh_1-1652306288622.png

 

Kind regards,

Rohit


Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos!😊

That worked!

That's great @jbenson . Happy to help!
Please mark this answer as the solution to help others as well! 
Really appreciate your kudos!

 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.