Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Generate running time rows/table

Hello everyone,

 

I am trying to get the running time of a machine & I have only the stoppages recorded + few details on the starting/ending time.

Facts that I know is that on a daily basis the machine starts running at 07h00 am & stops at 15h00 pm / weekend off.

 

Current information available:

info available.PNG

 

 

 

 

 

 

 

 

The information I need is actual running time as per below:

desired info.PNG

 

 

 

 

 

 

Any suggestion or idea would be highly appreciated! 😊

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

The algorithm would be something like:   (Power Query)

Take the original 'Date Fin' Column and add in a record for 0700 for each date . This will end up as the 'Date Debut' column

-> So take the column , separate date and time, remove the time column. Remove duplicates. Add a column for time 0700.  Merge columns to get a table with one column which is 0700 for each date.

Append this table to a table that holds the original 'Date Fin' column. Sort it by datetime.

 

You'll want to do a similar thing to the original 'Date Debut' column , by adding a 1500 record for each day to make the final 'Date Fin' column.

 

You then have to find a way of Merging the 2 tables to get the records to line up.  I'm thinking of a new column with just the Date in each table.  Create an index column with in each day so

1.9.20 0700        1.9.20      1

1.9.20 0805        1.9.20      2

.....

2.9.20 0700        2.9.20     1

 

 

You can then Merge the 2 tables on Date and Index columns.  After that, you calculate the duration column. 

 

Take each step carefully.  Good luck.

View solution in original post

2 REPLIES 2
HotChilli
Super User
Super User

The algorithm would be something like:   (Power Query)

Take the original 'Date Fin' Column and add in a record for 0700 for each date . This will end up as the 'Date Debut' column

-> So take the column , separate date and time, remove the time column. Remove duplicates. Add a column for time 0700.  Merge columns to get a table with one column which is 0700 for each date.

Append this table to a table that holds the original 'Date Fin' column. Sort it by datetime.

 

You'll want to do a similar thing to the original 'Date Debut' column , by adding a 1500 record for each day to make the final 'Date Fin' column.

 

You then have to find a way of Merging the 2 tables to get the records to line up.  I'm thinking of a new column with just the Date in each table.  Create an index column with in each day so

1.9.20 0700        1.9.20      1

1.9.20 0805        1.9.20      2

.....

2.9.20 0700        2.9.20     1

 

 

You can then Merge the 2 tables on Date and Index columns.  After that, you calculate the duration column. 

 

Take each step carefully.  Good luck.

Anonymous
Not applicable

Thank you VERY much for your help!! 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.