Forum Discussion
Joining Events with same End time and Start time
I am working with time tracking software that records events occuring on our production lines. However when events cross shifts/dates/etc it will break that 1 event into multiple line items in the data server.
Ex. Shifts are 5:00-17:00 and 17:00 to 5:00. Large cleaning/serving event (expected to take 24hrs) on line from 1/5/23 6:00 to 1/6/2023 6:00 SHOULD be 1 line item at 24 hours but instead the data table which power bi pulls from breaks it into 5 line items.
1/5/23 6:00-1/5/23 17:00 > 11hrs (event start to shift change)
1/5/23 17:00 -1/6/23 00:00 > 7 hrs (shift change to date change)
1/6/23 00:00 - 1/6/23 5:00 > 5hrs (date change to shift change)
1/6/23 5:00 - 1/6/23 6:00 > 1hrs (shift change to end of event)
When you want to pull historical events and compare actual vs expected you will receive 5 line items that are all significantly less than expected (11hrs/24hrs, 7hrs/24hrs, 5hrs/24hrs, 1 hrs/24hrs) and your event looks like it took half or less of the time it actually did.
How or what equation would join the start/end time of these events to result in 1 line item showing it took 24hrs compared to the 24hrs expected duration? This also should be based on event description if "Cleaning" is back to back it should continue but once it goes from "cleaning" to "off","running", "maintenance", etc it should stop joining those events.
Some examples from the data for batch change and you can see it has multiple line items for same events based on start/end times