Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Any help is appreciated.
With the current shift profile:
(5:00:00 to 16:59:59) day shift (1) and (17:00:00 to 4:59:59) afternoon shift (2)
We need to calculate "Run Time" between the AR in the shift.
LAST ENTRY – FIRST ENTRY = RUN TIME (MINUTES)
For example, the first entry for AR 40 (Slicer) in Shift 1 (Slicer) on March 15th (slicer)
First entry = 5:25:18
Last entry = 6:15:18
Again
First entry = 17:00:05
Last entry = 17:06:38
I need to calculate the minutes between both instances or add the minutes as many instances happen with the shift. This how that these how many minutes production ran for that particular AR
Date | Time | AR | Cavity | Shift | Status |
3/15/2021 | 4:18:28 | 40 | 2 | 2 | 1 |
3/15/2021 | 5:25:18 | 40 | 2 | 1 | 1 |
3/15/2021 | 6:15:18 | 40 | 2 | 1 | 1 |
3/15/2021 | 6:45:18 | 67 | 2 | 1 | 1 |
3/15/2021 | 7:00:18 | 67 | 2 | 1 | 1 |
3/15/2021 | 7:15:18 | 40 | 2 | 1 | 1 |
3/15/2021 | 17:00:05 | 40 | 2 | 1 | 1 |
3/15/2021 | 17:06:38 | 40 | 2 | 2 | 1 |
3/15/2021 | 18:10:38 | 40 | 2 | 2 | 1 |
3/15/2021 | 18:15:38 | 40 | 2 | 2 | 1 |
3/15/2021 | 19:40:38 | 67 | 2 | 2 | 1 |
Solved! Go to Solution.
@lotus22 at in that case, I would combine the date and time into a single DateTime in PowerQuery and then use that instead of just the time piece. The key piece is to identify the runs (which I do by sorting by AR then DateTime, then adding index, figuring out if it starts on odd or even number, then marking each run pair) then from that it's simple to calculate the time between when it starts and when it stops.
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
@lotus22 I think you are trying to get to this stage:
I was able to get that by first figuring out the "Run Index" then determining the difference in time (I averaged it here in the total) between the start and end times.
In Power Query,
I import it, then created these calculated columns:
Then finally these measures:
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
Hi DataZoe, Thank you for your answer. Another issue is that Shift 2 wraps into the next day
(5:00:00 to 16:59:59) day shift (1) and (17:00:00 to 4:59:59) afternoon shift (2)
I am not sure if your solution will take care of that as well. Production would like to know truly how many minutes we build the Parts in the first and second shifts.
@lotus22 at in that case, I would combine the date and time into a single DateTime in PowerQuery and then use that instead of just the time piece. The key piece is to identify the runs (which I do by sorting by AR then DateTime, then adding index, figuring out if it starts on odd or even number, then marking each run pair) then from that it's simple to calculate the time between when it starts and when it stops.
Respectfully,
Zoe Douglas (DataZoe)
Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.