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
tstoski
New Member

Add new rows based on time span condition

Hi everyone,

 

I am struggling to add new rows based on specific conditions using power query. Here is an example of what I want to do:

On my dataset I have a column for the start time and for the end time, which is related to machine working hours at work. We have 3 shifts during the day:

1st shift from 7am to 3pm

2nd shift from 3pm to 11pm 

3rd shift from 11pm to 7am

tstoski_1-1629824594993.png

 

For example, if the start time is at 10 AM and the end time is at 4 PM, that means the machine was stopped during 6 hours, 5 hours in the first shift and 1 hour during the second shift, what I am trying to do is to split the rows in which one row has the start time at 10 AM and end time at 3 PM and create a second row where the start time is at 3 PM and end time at 4pm, keeping the same data on the other columns. Does anyone know how to solve this?

 

Thanks in advance.

1 REPLY 1
v-easonf-msft
Community Support
Community Support

Hi,  @tstoski 

You need to do column expansion in PQ . The question is beyond my capabilities.
It is suggested to post your question to  Power Query forum as well,  where there are many proficient M query users.

 

Best Regards,
Community Support Team _ Eason

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.