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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Julbak
Frequent Visitor

Regroup lines together according to Time range

Dear all,

 

I need help regarding a way to combine lines together according to a time range.

I have got a facts table regrouping production stops/running time and also energy data in the same table. 

 

For example: 

I have got one Fabrication Order (FO) starting at 6:00 AM and finishing at 3:45 PM. Within this range I have got 2 breakdowns:

- Breakdown 1: from 6:00 AM to 7:AM = changeover time ( 1 hour )

- Breakdown 2: from 7:45 to 8:15 so 30 min

 

Then I have got lot of lines every 10 mins with the energy consumption at this point (for example from 6:00 AM to 6:10 AM I have got 10 lines with the machine and the energy consumed). 

 

Can you advise me what type of function can I use to split for example each breakdown and the running time into columns to know what kind of breakdon/running time it was?

 

Today it is one line for each breakdown but I want to split this line into several lines but separated by 10 min and fit with the energy consumptions date/hour. 

I don't know if it is clear... The idea is to link the energy consumptions according to the line statement (running or stopped)

 

Thanks in advance

1 ACCEPTED SOLUTION
v-jianpeng-msft
Community Support
Community Support

Hi, @Julbak 

According to your description, you can use the split column function in Power Query with the merge columns function to implement your requirements. Here's the sample data I used:

vjianpengmsft_0-1714533700908.png

You need to make sure that each of your lines has a similar form. Use the split column function as follows:

vjianpengmsft_0-1714533992982.png

Here are the results:

vjianpengmsft_1-1714534026038.png

Next, use the function to merge columns:

vjianpengmsft_2-1714534078654.png

vjianpengmsft_3-1714534097823.png

vjianpengmsft_4-1714534267371.png

Change the type of these two columns to time:

vjianpengmsft_5-1714534318722.png

Finally, add a custom column, and the calculation logic is shown in the following figure:

vjianpengmsft_6-1714534399514.png

The final result is as follows:

vjianpengmsft_7-1714534461112.png

I've provided the PBIX file used this time below.

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Julbak
Frequent Visitor

Hello Thanks for the answer, I will look at it but at least I have got something as a base to work on. Thank you again

v-jianpeng-msft
Community Support
Community Support

Hi, @Julbak 

According to your description, you can use the split column function in Power Query with the merge columns function to implement your requirements. Here's the sample data I used:

vjianpengmsft_0-1714533700908.png

You need to make sure that each of your lines has a similar form. Use the split column function as follows:

vjianpengmsft_0-1714533992982.png

Here are the results:

vjianpengmsft_1-1714534026038.png

Next, use the function to merge columns:

vjianpengmsft_2-1714534078654.png

vjianpengmsft_3-1714534097823.png

vjianpengmsft_4-1714534267371.png

Change the type of these two columns to time:

vjianpengmsft_5-1714534318722.png

Finally, add a custom column, and the calculation logic is shown in the following figure:

vjianpengmsft_6-1714534399514.png

The final result is as follows:

vjianpengmsft_7-1714534461112.png

I've provided the PBIX file used this time below.

 

 

 

 

How to Get Your Question Answered Quickly

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

Best Regards

Jianpeng Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors