cancel
Showing results 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

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

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.

Announcements

Join Arun Ulag at MPPC23

Get a sneak peek into this year's Power Platform Conference Keynote.

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Top Solution Authors
Top Kudoed Authors