Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Transpose table column values

Hello All,

I have a table which is having three columns as below.

 

Now i would like to conver this table as

 Is it possible with powerbi.

Any suggestions.

 

Thanks you

Mohan V.

 

 

 

 

 

 

  • Hi Anonymous,

     

    Based on my test about Greg_Deckler's Power Query code, it can achieve your requirement, see:

     

     

    Also you can select "Current Status" and "Next Action" columns then click Unpivot Columns, then use matrix visual to display data. 

     

     

    Best Regards,
    Qiuyun Yu

6 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi All,

     

    If you go to Format / Values turn on "Show on rows". and you'll have it.

     

    Best regards,

     

     

    • rlele's avatar
      rlele
      Frequent Visitor

      Hi Anonymous 

       

      Thank you so much. 

      This is exactly i was looking for

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    How about this one?

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCkkszjZU0lEKSM1LycxLVyjPLMlQqAAKJGekJmfDuLE6EJVG6CorUVVWwlUao6usQlVZpRQbCwA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Task = _t, #"Current Status" = _t, #"Next Action" = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Task", type text}, {"Current Status", type text}, {"Next Action", type text}}),
        #"Transposed Table" = Table.Transpose(#"Changed Type"),
        #"Promoted Headers" = Table.PromoteHeaders(#"Transposed Table", [PromoteAllScalars=true]),
        #"Added Index" = Table.AddIndexColumn(#"Promoted Headers", "Index", 0, 1),
        #"Added Conditional Column" = Table.AddColumn(#"Added Index", "Custom", each if [Index] = 0 then "Current Status" else "Next Action" ),
        #"Removed Columns" = Table.RemoveColumns(#"Added Conditional Column",{"Index"})
    in
        #"Removed Columns"
    • Anonymous's avatar
      Anonymous
      Not applicable

      thanks for the reply Greg_Deckler.

      I did tried this already.

      But it dosent matches with my requirement.

      Can you suggest any other way please.

       

      thank you.

      Mohan V

      • v-qiuyu-msft's avatar
        v-qiuyu-msft
        Community Support

        Hi Anonymous,

         

        Based on my test about Greg_Deckler's Power Query code, it can achieve your requirement, see:

         

         

        Also you can select "Current Status" and "Next Action" columns then click Unpivot Columns, then use matrix visual to display data. 

         

         

        Best Regards,
        Qiuyun Yu