Forum Discussion
Result Not as Expected - DAX Calculating Working Hours Between Dates
Hello
I am using DAX I found on a forum to help me calculate Response Time between two dates, only within working hours and on working days. Below, you can see the DAX and some results:
It's not giving me the expected result, and I'm not sure why. In the example highlighted yellow, the call was created on 03/04/23 at 14:54 and we arrived on the 04/04/23 at 10:51. The number of working hours (08:30-17:00, Mon-Fri) between the two dates/times is circa 4.2 hours, but I'm getting a result of 2.4 hours. All the results are lower than they should be. Please can you help me figure out why? I adapted this DAX from something I found in a forum, so I am perhaps missing the logic behind something. The clock should just count hours within those working hours, stopping at 17:00 and starting again at 08:30 the following day.
DAX pasted below, if it helps... Many Thanks!
9 Replies
- Greg_Deckler
Community Champion
CMoppet I did this once: Net Work Duration (Working Hours) - Microsoft Fabric Community
- CMoppet
Helper IV
Hello 🙂 I've already tried your method today! It didn't like me! All my results were 510...for every row. I couldn't figure out why! Anything obvious wrong with the different approach I used above?
- CMoppet
Helper IV
Just tried it again....not sure what I'm missing...
- CMoppet
Helper IV
As an add on, when I did it, I got errors because some of my rows have no start date or time. And it didn;t seem to like that. For the rows without any dates, I just want blank results....