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

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

I have a Matrix visualization like below-

 

OutcomeAssignmentCriteriaScorePercentage
Outcome 1Assignemnt 1Criteria 1422%
  Criteria 2450%
  Criteria 3480%
  Overall440%
Outcome 1Assignment 2Criteria 1330%
  Overall335%
  Criteria 2340%
Outcome 2Assignment 4Criteria1220%
  Critearia225%
  Overall26%
Outcome 3Assignment 4Criteria 117%
  Criteria 2114%
  Overall128%
     

 

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-

Ask question.PNG

 

Can I get any help on this issue?

1 ACCEPTED SOLUTION
v-binbinyu-msft
Community Support
Community Support

Hi @rohanazad94 ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1668047000945.png

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

vbinbinyumsft_1-1668047175456.png

vbinbinyumsft_2-1668047205556.png

Output:

vbinbinyumsft_3-1668047230368.png

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.

View solution in original post

2 REPLIES 2
rohanazad94
Frequent Visitor

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

v-binbinyu-msft
Community Support
Community Support

Hi @rohanazad94 ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1668047000945.png

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

vbinbinyumsft_1-1668047175456.png

vbinbinyumsft_2-1668047205556.png

Output:

vbinbinyumsft_3-1668047230368.png

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
Exciting changes

Power BI Community Changes

Check out the changes to the Power BI Community announced at Build.

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Kudo Data Story carousel

Data Stories Gallery

Visit our Data Stories Gallery and give kudos to your favorite Data Stories.

Top Solution Authors