cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ruliana
Helper I
Helper I

Grouping specific rows together

I have a data set of production values from various machines that I'm using to calculate machine utilization. I used group by to combine the values into machine and date and sum the run hours. Below shows the data. The rows are machine, date, mfg cell, mfg type, run hours, and scheduled hours.

 LEGO pic  080119.PNG

I want to combine 0556-LEGO 2-1 and 2-2 into one value (0556). Is there any way to group these into one column so they don't show up as duplicates in my sums without having to filter one out?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@ruliana 

I see. Does this possibly work? I added Column 2, 3, 4, and 6 to the GROUP BY function in order to return them.

Capture1.PNG

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

@ruliana 

Before using Group By, you could try to just replace both variable names with "0556." In "Edit Queries," you can:

1. Select the entirety of that first column

2. Right click, find "Replace Values..."

3. Replace "0556-LEGO 2-1" and "0556-LEGO 2-2" with "0556"

4. THEN use Group By to group the values of "0556" together

Does that work?

Thanks! The problem with that is that when I group them, I sum the run hours so if a press makes two different parts in a day, it'll say it ran for the sum of those two parts.

Anonymous
Not applicable

@ruliana 

I see. So you just want an average then?

Yeah an average would work for that press if it can be done separately from grouping the others.

Anonymous
Not applicable

@ruliana 

I see. Does this possibly work? I added Column 2, 3, 4, and 6 to the GROUP BY function in order to return them.

Capture1.PNG

I think that'll do it! Thanks

Helpful resources

Announcements
May 23 2022 epsiode 5 without aka link.jpg

The Power BI Community Show

Welcome to the Power BI Community Show! Jeroen ter Heerdt talks about the importance of Data Modeling.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through June10th!

Power BI Dev Camp Session 22 without aka link and time 768x460.jpg

Check it Out!

Watch Session 22 Ted's Dev Camp along with past sessions!

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!

Top Kudoed Authors