Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi @rogerthat
Check my blog post about Calculating business hours using DAX and you can find the solution there:
https://www.vahiddm.com/post/calculating-business-hours-in-power-bi-using-dax
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
@VahidDM - Actually used this method, however I'm trying to implement different Work Hours for saturday which is an hour less than M-F.
M-F 6:00AM TO 6:00P
Hi @rogerthat
you can modify the code and add the SATURDAY condition
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
I modified but some holidays dates are still being accounted for.
You need to add holidays to the Calendar Table.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Yes that's also been added, but adding the calendar wont filter the holidays.
can you share your PBIX file with me [after removing sensetive data]
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Can you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).
Column1 | Column2 |
A | 1 |
B | 2.5 |
This is a calculated column, correct?
@Stachu - correct, its a calculated column.
MONDAY THRU FRIDAY- 6:00AM TO 6:00P
Start (DATETIME) | End (DATETIME) | Expected Working Hours |
10/9/2021 4:00:00 PM | 10/11/2021 8:00:00 AM | 3 |
10/23/2021 4:00:00 PM | 10/23/2021 6:00:00 PM | 1 |
10/29/2021 5:00:00 PM | 10/30/2021 8:00:00 AM | 3 |
can you add sample that would have holiday day in? or in such case there wouldn't be any entries overlapping with the holidays?
Start (DATETIME) | End (DATETIME) | Expected Working Hours |
10/9/2021 4:00:00 PM | 10/11/2021 8:00:00 AM | 3 |
10/23/2021 4:00:00 PM | 10/23/2021 6:00:00 PM | 1 |
10/29/2021 5:00:00 PM | 10/30/2021 8:00:00 AM | 3 |
7/1/2021 5:00:00PM | 7/5/2021 8:00:00 AM | 14 |
MONDAY THRU FRIDAY- 6:00AM TO 6:00P