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)

IDNameValue
1AX
1BY
2AZ
2BW


Table 2 (New)

IDAB
1XY
2ZW
  • 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

4 Replies

  • 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

  • Anonymous Try to use Matrix visual and add the fields like below:

     

    • Tahreem24's avatar
      Tahreem24
      Super User

      Anonymous and if you don't want the total column at the end so you can set it off like this:

       

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Thanks but, it didnt help!