Forum Discussion
Hours Worked
- 4 years ago
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 :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.
Kind regards,
Rohit
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos!😊
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 :
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.
Kind regards,
Rohit
Please mark this answer as the solution if it resolves your issue.
Appreciate your kudos!😊
- jbenson4 years agoHelper III
That worked!
- rohit_singh4 years agoSolution Sage
That's great jbenson . Happy to help!
Please mark this answer as the solution to help others as well!
Really appreciate your kudos!