Forum Discussion

shanebo3239's avatar
shanebo3239
Helper I
8 years ago
Solved

Pivoting Data Question

I have an import from a web page that looks something like this:   Col1 | Col2 ID | 1 Name | John Age | 33 ID | 2 Name | Sam Age | 12 ID | 3 ...
  • Vvelarde's avatar
    8 years ago

    shanebo3239

     

    Hi, you need a column to applied the pivot.

     

    Please follow these steps.

     

     

    Regards

     

    Victor

    Lima - Peru

  • shanebo3239's avatar
    shanebo3239
    8 years ago

    Victor,

     

    That is a much simpler solution than what I ended up doing (right before you posted, unfortunately!)

     

    Anyway, here's what I ended up with.  First, I did a group by in query editor and grouped by Col1.  That left me with a "List" link in Col2, which is now called GR1.  Then, using advanced editor I did this:

     

    Table.PromoteHeaders(Table.FromColumns(Table.Group(Col1, {{"GR1", each List.InsertRange([Col2],0,List.Distinct([Col1]))}})[GR1]))

     

    Not pretty, but it works.

     

    Thank you so much!