Forum Discussion

binayjethwa's avatar
binayjethwa
Helper V
3 years ago
Solved

How to handle multiple values on Rows in Matrix visual.

Hi ,   Is there any better way we can handly multiple row values in matrix.   Basically i need to show a matrix visual which has around 25 row items , columns i need to show dates , and values i ...
  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi binayjethwa 

    You can refer to the following suggestion.

    Unpivot the 'address' column, then combine it.

    e.g 

    You can put the following code to advanced editor in power query

     

    let
        Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMjQyVNJRSkxJBJLFxcVgMgVIGhoZgUmHwnK95PxcI2Mj45QUkIQCSElKMUjW2MQYxAFiI2MwYZoCphLBZDGcjQsZGijFxgIA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Emp NO" = _t, name = _t, #"Region " = _t, #"location " = _t, #"phone num" = _t, #"email " = _t, #"address 1" = _t, #"address 2" = _t, #"address 3" = _t, #"address 4" = _t, #"address 5" = _t, #"address 6" = _t, #"address 7" = _t, #"address 8" = _t, #"address 9" = _t, #"address 10" = _t, #"address 11" = _t, #"address 12" = _t, #"address 13" = _t, #"address 14" = _t, #"address 15" = _t, #"address 16" = _t, date = _t, Value = _t]),
        #"Changed Type" = Table.TransformColumnTypes(Source,{{"Emp NO", Int64.Type}, {"name", type text}, {"Region ", type text}, {"location ", type text}, {"phone num", Int64.Type}, {"email ", type text}, {"address 1", type text}, {"address 2", type text}, {"address 3", Int64.Type}, {"address 4", type text}, {"address 5", Int64.Type}, {"address 6", type text}, {"address 7", type text}, {"address 8", type text}, {"address 9", type text}, {"address 10", type text}, {"address 11", type text}, {"address 12", type text}, {"address 13", type text}, {"address 14", type text}, {"address 15", type text}, {"address 16", type text}, {"date", type text}, {"Value", type text}}),
        #"Removed Columns" = Table.RemoveColumns(#"Changed Type",{"address 10", "address 11", "address 12", "address 13", "address 14", "address 15", "address 16"}),
        #"Unpivoted Only Selected Columns" = Table.Unpivot(#"Removed Columns", {"address 1", "address 2", "address 3", "address 4", "address 5", "address 6", "address 7", "address 8", "address 9"}, "Attribute", "Value.1"),
        #"Merged Columns" = Table.CombineColumns(Table.TransformColumnTypes(#"Unpivoted Only Selected Columns", {{"Value.1", type text}}, "en-US"),{"Attribute", "Value.1"},Combiner.CombineTextByDelimiter("-", QuoteStyle.None),"Merged")
    in
        #"Merged Columns"

     

    Then put the column to the row

     

    Best Regards!

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.