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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Conditional Formatting - top 3

I have a report that is like a league table. Is it possible to have, for a given column, conditional formatting rules that will highlight the top 3 values within this column? Actually I want each 3 values to be a slightly different colour to distinguish between the best, 2nd best and 3rd best in that column.

 

I intend to do similar rules to many columns, and having all rows rather than just the top 3 in each column formatted doesn't look nice. Having a "top 3" is the key thing but the formatting rules don't appear to allow it.

1 ACCEPTED SOLUTION
DataInsights
Super User
Super User

@Anonymous, try this:

 

1. Create the following measures:

Category Rank = 
RANKX ( ALL ( TestData[Category] ), CALCULATE ( SUM ( TestData[Amount] ) ), , ASC, Dense )

Category Rank Color = 
SWITCH ( [Category Rank],
1, "#CDE7FF",
2, "#72BCFF",
3, "#1B92FF"
)

 

2. Add [Category Rank] (and other fields) to a matrix.

 

3. Add conditional formatting to [Category Rank] as follows: format by Field value, based on field Category Rank Color.

 

DataInsights_0-1597610889321.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
DataInsights
Super User
Super User

@Anonymous, try this:

 

1. Create the following measures:

Category Rank = 
RANKX ( ALL ( TestData[Category] ), CALCULATE ( SUM ( TestData[Amount] ) ), , ASC, Dense )

Category Rank Color = 
SWITCH ( [Category Rank],
1, "#CDE7FF",
2, "#72BCFF",
3, "#1B92FF"
)

 

2. Add [Category Rank] (and other fields) to a matrix.

 

3. Add conditional formatting to [Category Rank] as follows: format by Field value, based on field Category Rank Color.

 

DataInsights_0-1597610889321.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors