Forum Discussion

Dr. U's avatar
Dr. U
Copper Contributor
May 29, 2018
Solved

Combine data from multiple rows into a single row

My apologies for the long post... I've been wrestling with this for awhile and am at wit's end...   I have a table of data that contains the results of chemical analyses of water samples. There is ...
  • SergeiBaklan's avatar
    May 29, 2018

    Hi Matt,

     

    Attached is the sample with Power Query. That's done not optimal way to avoid coding and do all from UI, just to demonstrate the approach.

     

    In brief, we unpivot other than SampleID columns, remove duplicates (as Var6, Var7), in second query Columns generate list of columns to be sure empty ones will be included (Var4, Var5), append that query to first one and pivot on attribute finally. Not sure if you need empty Row# column in final result, could be added.

    Please see attached.

Resources