Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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 🙂 !
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 55 | |
| 34 | |
| 31 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 74 | |
| 71 | |
| 38 | |
| 35 | |
| 25 |