I'm hoping that there is an easier way to go about this than what I have been trying to do. We have trucks that run 24/7. Within there, we have shifts that can start at anytime. The majority run less than 11 hours, but we have some that will span multiple days. I am wanting to know, for a given 24 hour period of time, what percent is connected to a shift.
I have a column with shiftstartdatetime, and a column with shiftenddatetime. I also have a separate table for dates titled Date.
I can get the total number of hours in a shift, but it is relating that back to utilization, esp if I have a shift end in the morning and another pick up in the afternoon; or if one runs multiple days(across country)
I'd even take a hint at where to look. Figuring it is going to be a couple calculated columns first, then a measure.
Yeah, I've done a fair amount with tricky time manipulation. I have a whole chapter in my book on Time, including Shift calculations although not exactly what you have going on. Also, there is a Utilization recipe. (DAX Cookbook).
Here are some links to some of the work I have done around time and such that hopefully will point you in the right direction.
We'd need to see some data to really work on this. Additionally, you should put all your column calculations in Power Query if possible, not in DAX. See links below for the reasons. As far as data, we'd also need to see some expected output.
I'm not clear about your requirement. If you need help, please share some sample data and expected results. Then we will understand clearly. If you have resolved it, please share your solution here. More people who have the same request will benefit from this thread.
Best Regards, Xue Ding If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.