Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
Anonymous
Not applicable

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 @Anonymous . The solution that you provided worked.

Anonymous
Not applicable

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

Check out the August 2024 Power BI update to learn about new features.

August Carousel

Fabric Community Update - August 2024

Find out what's new and trending in the Fabric Community.