Reputation: 501
I created this matrix and I set its value on rows to have this visual :
And I want to change the background color of each row according to my customer canvas like this:
Is it possible to do that ? bacause I tried formatting condition but it didn't work
Upvotes: 4
Views: 11068
Reputation: 6950
Of course it is possible. Add a column with color id to your source table. Say, 1, 2, 3, 4 will be respectively green, yellow, red, blue. Be sure that the color id is a number.
Display your data with table visual. Then, add conditional formatting to each column.
Set it up in this way:
Fields 1-4 enter exactly as they are shown above. I think these settings are self explanatory. Fields 5-6 are up to you. Repeat the row conditional formatting for every column. And you are done:
Here is a sample code to reproduce the source table:
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WMlTSUUosKMhJVYrViVYyAvKSEvOAEMw1BnKTM1KLiirBXBMgNyW1PAkiEAsA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", Int64.Type}, {"Column2", type text}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"Column1", "ColorID"}, {"Column2", "Category"}})
in
#"Renamed Columns"
Upvotes: 3