Search code examples
excelpowerquerytransposedata-wranglingm

Power query / Excel transpose restructure data data


This is the updated question: I like to change a table looking like this

enter image description here

into a table looking like this:

enter image description here

how can I do this?

Because I cannot handle programming language very well. Can anyone show me how do this with the menu bar?

Best regards wbart


Solution

  • In powerquery, paste into home ... advanced editor...

    let Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    #"Grouped Rows" = Table.Group(Source, {"name", "Symbol"}, {{"data", each Text.Combine(List.Transform([value], Text.From), ","), type text}}),
    #"Sorted Rows" = Table.Sort(#"Grouped Rows",{{"Symbol", Order.Ascending}}),
    #"Pivoted Column" = Table.Pivot(#"Sorted Rows", List.Distinct(#"Sorted Rows"[Symbol]), "Symbol", "data")
    in  #"Pivoted Column"