# Power Query Merge rows with some duplicate data



## clmish (Mar 4, 2021)

How to merge rows in Power Query if some columns are duplicate.
Unfortunately I can't post an example, but the data I'm working with first needed the Pivot Columns function performed to move toward columnar data structure. The result is that I have multiple rows for the same metadata, with other columns containing values in one of the rows. There are about 70 columns involved!

I'm manually merging them with ASAP-Utilities, due to a time crunch (I'm not good/fast at VBA from scratch), but there can be thousands of otherwise duplicate rows that I need to combine to one record per transaction. I've seen "GroupKind", maybe, but am not expert enough in PQ/PP to know how to use it (if it's even the right tool).
Thanks All!

Roughly, the data looks like this:


StaticData1StaticData2VariableData1VariableData2VariableData3Joe123OHJoe123ToledoJoe1232.50Fred456MIFred456MIFred456Grand RapidsFred4561.25

And I need:

StaticData1StaticData2VariableData1VariableData2VariableData3Joe123OHToledo2.50Fred456MIGrand Rapids1.25


----------



## clmish (Mar 4, 2021)

A Tableau buddy of mine said he would use GroupBy in that application. Is that what would make sense in merging these rows?


----------

