The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Multiple machines are concurrently engaged, recording temperature values and timestamps (in the format yyyy/M/d HH:mm:ss). All data is consolidated into a single table with four columns: Column A represents the machine code (e.g., SN001, SN002...), Column B represents time(e.g., 2023/11/27 11:36:12, 2023/11/28 11:00:05...)., Column C represents events, and Column D represents temperature values
The objective is to understand the operational time for each machine between 'Experiment Start' and 'Experiment End' events, where each segment (starting with the first temperature value < 1 and ending with the last temperature value > 1) has continuous temperature values < 1, and the cumulative time is greater than 1 hour.
Column E will be used to indicate the status (Begin Calculation, Calculating, End Calculation), while Column F will be utilized for the cumulative time. If the cumulative time is greater than 1 hour, the value will be inserted into the last temperature value < 1 for that segment (in hours).
Example:
| Machine Code | Time | Event | Temperature | Status | Cumulative Time |
|--------------|----------------------|------------------|-------------|----------------|-----------------|
| SN001 | 2023/11/27 10:50:00 | Experiment End | null | null | null |
| SN001 | 2023/11/27 11:00:00 | Experiment Start | null | null | null |
| SN002 | 2023/11/27 11:40:00 | Experiment Start | null | null | null |
| SN002 | 2023/11/27 11:50:00 | Add X Element | 0.5 | null | null |
| SN002 | 2023/11/27 12:00:00 | Add X Element | 1.5 | null | null |
| SN001 | 2023/11/27 12:30:00 | Add M Element | 0.5 | Begin Calculation | null |
| SN001 | 2023/11/27 12:40:00 | Add M Element | 1.8 | Calculating | null |
| SN001 | 2023/11/27 13:00:00 | Add T Element | 0.9 | Calculating | null |
| SN001 | 2023/11/27 14:30:00 | Add T Element | 0.5 | Calculating | null |
| SN001 | 2023/11/27 15:30:00 | Add T Element | 0.7 | Calculating | null |
| SN001 | 2023/11/27 16:30:00 | Add T Element | 1.5 | End Calculation | 4 |
| SN002 | 2023/11/27 17:30:00 | Add T Element | 0.5 | Begin Calculation | null |
| SN001 | 2023/11/27 17:40:00 | Add T Element | 1.6 | null | null |
| SN002 | 2023/11/27 18:30:00 | Add T Element | 1.6 | End Calculation | 1 |
| SN001 | 2023/11/27 11:00:00 | Experiment End | null | null | null |
| SN002 | 2023/11/27 11:00:00 | Experiment End | null | null | null |
| SN002 | 2023/11/27 16:40:00 | Add T Element | 1.8 | null | null |
......
...more than 24 thousand records
In the 'Experiment End' to 'Experiment Start' event period, both the status and cumulative time should be null.
Hello @Goway ,
you need to transform this in power query to show the start date and end date as columns in power query, then this would be easier to calculate. you need to use pivot columns.
Proud to be a Super User! | |