cancel
Showing results for
Search instead for
Did you mean:
Frequent Visitor

## Is it possible to have certain rows in a matrix visualization to be color coded?

I have a Matrix visualization like below-

 Outcome Assignment Criteria Score Percentage Outcome 1 Assignemnt 1 Criteria 1 4 22% Criteria 2 4 50% Criteria 3 4 80% Overall 4 40% Outcome 1 Assignment 2 Criteria 1 3 30% Overall 3 35% Criteria 2 3 40% Outcome 2 Assignment 4 Criteria1 2 20% Critearia2 2 5% Overall 2 6% Outcome 3 Assignment 4 Criteria 1 1 7% Criteria 2 1 14% Overall 1 28%

Outcome, assignment, Criteria are in "rows" and score, percentage are in "Values" of Matrix visualization.

The rows that have Overall in "Criteria" column, I am hoping for "Percentage" in those rows to be color coded.
For rows having Score =4, "Percentage" should be Green,
rows having Score =3, "Percentage" should be Purple,

rows having Score =2, "Percentage" should be Yellow,

rows having Score =1, "Percentage" should be Red.

The final outcome that I am hoping for is shown below-

Can I get any help on this issue?

1 ACCEPTED SOLUTION
Community Support

Hi @rohanazad94 ,

Please try below steps:

1. below is my test table

Table:

2. create a measure with below dax formula

``````Measure =
VAR cur_ct =
SELECTEDVALUE ( 'Table'[Criteria] )
VAR cur_score =
SELECTEDVALUE ( 'Table'[Score] )
RETURN
SWITCH (
TRUE (),
cur_score = 4
&& cur_ct = "Overall", "Green",
cur_score = 3
&& cur_ct = "Overall", "Yellow"
)
``````

3. add a matrix visual with fields, and set condition format for "Score" field

Output:

For more details about conditional format, you can read related document: Apply conditional table formatting in Power BI - Power BI | Microsoft Learn

Please refer the attached .pbix file.

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

2 REPLIES 2
Frequent Visitor

Thank you so much @v-binbinyu-msft . The solution that you provided worked.

Community Support

Hi @rohanazad94 ,

Please try below steps:

1. below is my test table

Table:

2. create a measure with below dax formula

``````Measure =
VAR cur_ct =
SELECTEDVALUE ( 'Table'[Criteria] )
VAR cur_score =
SELECTEDVALUE ( 'Table'[Score] )
RETURN
SWITCH (
TRUE (),
cur_score = 4
&& cur_ct = "Overall", "Green",
cur_score = 3
&& cur_ct = "Overall", "Yellow"
)
``````

3. add a matrix visual with fields, and set condition format for "Score" field

Output:

For more details about conditional format, you can read related document: Apply conditional table formatting in Power BI - Power BI | Microsoft Learn

Please refer the attached .pbix file.

Best regards,
Community Support Team_ Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

## Helpful resources

Announcements

#### Power BI T-Shirt Design Challenge 2023

Find out who won the T-Shirt Design Challenge and the top 3 finalists.

#### Power BI March 2023 Update

Find out more about the March 2023 update.

Top Solution Authors
Top Kudoed Authors