Forum Discussion
Excel 2016 power Query how to consolidate data into one common row
Hi,
I have a customer that likes the output but would like common rows to be consolidated into one row. Example: 3 rows have the same "Loop Number" but columns "IO1-IO8 Loop Number" may have separate data.
Is it possible to do or do I need to read into an array to write out a new table?
You may reference on the query and
1) Merge all NNN Loop Number columns into one column, let say Merged
2) Group By Loop Number with aggregating Merged column on Sum
3) Change in formula bar List.Sum([Merged]) on Text.Combine([Merged],",")
Reference on initial query once more and merge with previous one
7 Replies
- SergeiBaklanDiamond Contributor
You may reference on the query and
1) Merge all NNN Loop Number columns into one column, let say Merged
2) Group By Loop Number with aggregating Merged column on Sum
3) Change in formula bar List.Sum([Merged]) on Text.Combine([Merged],",")
Reference on initial query once more and merge with previous one
- rechoCopper Contributor
Many Thanks, after tweaking the following worked (Group By Advanced):
= Table.Group(#"Sorted Rows", {"Loop Number"}, {{"Sum1", each Text.Combine([IO1 Loop Number],","), type text}, {"Sum2", each Text.Combine([IO2 Loop Number],","), type text}, {"Sum3", each Text.Combine([IO3 Loop Number],","), type text}, {"Sum4", each Text.Combine([IO4 Loop Number],","), type none}, {"Sum5", each Text.Combine([IO5 Loop Number],","), type none}, {"Sum6", each Text.Combine([IO6 Loop Number],","), type text}, {"Sum7", each Text.Combine([IO7 Loop Number],","), type none}, {"Sum8", each Text.Combine([IO8 Loop Number],","), type none}})
- SergeiBaklanDiamond Contributor
recho , you are welcome, glad to know you sorted this out
- rechoCopper Contributor
I followed up to step 3 but some of the rows have more delimiters that the 8 columns merged. When I split the merged column I end up with 24 columns instead of the 8 original columns.
- SergeiBaklanDiamond Contributor
If you mean that delimiter sign is within texts, you may use any other one, e.g. "<SEP>" both on merging the columns and Text.Combine().