This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
Hi all,
I need help to calculate the time between two events.
Our events come through with Factory | Area | Zone | Machine | Reason
so when an area stops it always has Reason = Machine Unavailable, when an area restarts a machine and reason is entered
Stop: F4|Setting|Area J||Area Unavailable
Start: F4|Setting|Area J|H40|Motor Fault
I want ot calculate the duration between the two timestamps - I can't calculate previous rows as there are multiple areas / zones that could stop in the same table.
I've highlighted two examples in the table below where I've manually put in the duration but haven't figured out how to do this automatically. Hopefully then I can create visuals which display stop duration by machine, by area, by date etc...
Thanks!
| Date | Time | Type | Description | Factory | Area | Zone | Machine | Reason | DateTime | Index | Stop Time | DateTime.1 | Duration |
| 20-Jun-19 | 00:06:12 | Event | F4|Setting|Area H||Area Unavailable | F4 | Setting | Area H | Area Unavailable | 20/06/2019 00:06 | 677 | 0 | 20/06/2019 00:06 | ||
| 20-Jun-19 | 00:06:12 | Event | F4|Setting|Area J||Area Unavailable | F4 | Setting | Area J | Area Unavailable | 20/06/2019 00:06 | 678 | 0 | 20/06/2019 00:06 | ||
| 20-Jun-19 | 00:06:12 | Event | F4|Setting|Area L||Area Unavailable | F4 | Setting | Area L | Area Unavailable | 20/06/2019 00:06 | 679 | 0 | 20/06/2019 00:06 | ||
| 20-Jun-19 | 00:06:56 | Event | F4|Setting|Area L|H40|Motor Fault | F4 | Setting | Area L | H40 | Motor Fault | 20/06/2019 00:06 | 676 | 0 | 20/06/2019 00:06 | |
| 20-Jun-19 | 00:07:00 | Event | F4|Setting|Area J|H40|Motor Fault | F4 | Setting | Area J | H40 | Motor Fault | 20/06/2019 00:07 | 675 | 0 | 20/06/2019 00:07 | 00:01 |
| 20-Jun-19 | 00:07:01 | Event | F4|Setting|Area H|H40|Motor Fault | F4 | Setting | Area H | H40 | Motor Fault | 20/06/2019 00:07 | 674 | 0 | 20/06/2019 00:07 | |
| 20-Jun-19 | 00:07:49 | Event | F4|Setting|Area H||Area Unavailable | F4 | Setting | Area H | Area Unavailable | 20/06/2019 00:07 | 673 | 0 | 20/06/2019 00:07 | ||
| 20-Jun-19 | 00:08:01 | Event | F4|Setting|Area H|J MAIN AIR SUPPLY|Layer Problem | F4 | Setting | Area H | J MAIN AIR SUPPLY | Layer Problem | 20/06/2019 00:08 | 672 | 0 | 20/06/2019 00:08 | |
| 20-Jun-19 | 00:12:24 | Event | F4|Press|Area K||Area Unavailable | F4 | Press | Area K | Area Unavailable | 20/06/2019 00:12 | 671 | 0 | 20/06/2019 00:12 | ||
| 20-Jun-19 | 00:16:06 | Event | F4|Press|Area K|K50|Suction Head Insert | F4 | Press | Area K | K50 | Suction Head Insert | 20/06/2019 00:16 | 670 | 0 | 20/06/2019 00:16 | 00:04 |
Solved! Go to Solution.
Check out my video here. https://m.youtube.com/watch?v=xN2IRXQ2CvI
Check out my video here. https://m.youtube.com/watch?v=xN2IRXQ2CvI
Thank you!
Managed to apply the theory and get what I wanted 🙂 !
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 30 | |
| 23 | |
| 23 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 63 | |
| 36 | |
| 30 | |
| 23 | |
| 22 |