Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Help pls, help

How to create new table with data from another existing table Tablea 1 (Existing) ID Name Value 1 A X 1 B Y 2 A Z 2 B W Table 2 (New) ID A B 1 X Y 2 ...
  • PhilipTreacy's avatar
    5 years ago

    Hi Anonymous 

    Download example PBIX file

    Select the Name column in Power Query and pivot it with the Value column as values

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUXIE4gilWB0IzwmII8E8I6hcFJwHkgtXio0FAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [ID = _t, Name = _t, Value = _t]),
        #"Pivoted Column" = Table.Pivot(Source, List.Distinct(Source[Name]), "Name", "Value")
    in
        #"Pivoted Column"

    Regards

    Phil