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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors