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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
AndyMeiks
Frequent Visitor

Adding Ranking Visual to a Matrix

Hi team,

 

I have the attached example screenshot for statistics I'm working with - with Team names the hidden values.

I was wondering if I can add conditional formatting to rank each of these columns, i.e. highlight a cell green when the team has ranked #1 in that stat category and red when they're ranked #4.

AndyMeiks_0-1686812042166.png

Is this possible? I'm also open to adding a ranking column but wanting the data to stay looking clean.

 

Thanks so much.

 

 
 

1 ACCEPTED SOLUTION
Ritaf1983
Super User
Super User

Hi @AndyMeiks 
You can format your matrix without adding unnecessary columns.

Please follow these steps:

1. Create the measure for ranking teams in every category :

Team Rank =
RANKX(
    ALL('Table'[Team]),
    CALCULATE(
        SUM('Table'[Value]),
        ALLEXCEPT('Table', 'Table'[Catrgory], 'Table'[Team])
    )
)
Ritaf1983_0-1686881976431.png

2. Apply conditional formatting based on this measure :

Ritaf1983_1-1686882126288.png

According to global accessibility law, it is forbidden to use traffic light colors to create emphasis because color-blind people cannot see these differences.
My recommendation or emphasis is only on red or the combination of red with blue.

Ritaf1983_2-1686882384908.png

Link to the sample file 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 



View solution in original post

5 REPLIES 5
Ritaf1983
Super User
Super User

Hi @AndyMeiks 
You can format your matrix without adding unnecessary columns.

Please follow these steps:

1. Create the measure for ranking teams in every category :

Team Rank =
RANKX(
    ALL('Table'[Team]),
    CALCULATE(
        SUM('Table'[Value]),
        ALLEXCEPT('Table', 'Table'[Catrgory], 'Table'[Team])
    )
)
Ritaf1983_0-1686881976431.png

2. Apply conditional formatting based on this measure :

Ritaf1983_1-1686882126288.png

According to global accessibility law, it is forbidden to use traffic light colors to create emphasis because color-blind people cannot see these differences.
My recommendation or emphasis is only on red or the combination of red with blue.

Ritaf1983_2-1686882384908.png

Link to the sample file 

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly

 



Hi there,

 

Thanks for this - when I input it I get an error saying Can't display the visual, and the error message:

MdxScript(Model) (7, 13) Calculation error in measure 'Table'[Team Rank]: The function SUM cannot work with values of type String.

Any ideas on how I could find and fix this?

 

Thanks.

Hi again @AndyMeiks 

It says you trying to do calculations on the string column instead of a number...
Check your data types and modify them.

Thanks, I have fixed this and marked as accepted solution! The only question I have on this is would it be easy to adjust this to reverse the ranks in certain rows?

 

For example, in my table I have both Goals (ranked 1-4) and Missed Shots (ideally should have the lowest number ranked as #1). Is this possible or simpler to break into 2 different matrix?

It wasn't clear what you were trying to accomplish.
It might be easier if you attach a picture.

However, for effective data visualization, one graph per message is most effective.
Maybe it is worth separating so that the user does not have to decode multiple messages from the same graph regardless of technical possibilities.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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