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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
nish2288
Helper I
Helper I

Color top 5 rows in a table

Hi All,

 

I have created table with 20 rows.

I wanted to color first 5 rows only.

Any idea?

1 ACCEPTED SOLUTION

I was able to find the solution for this.

 

Solution:

Step 1:  Create measure(M1)and use RANKX function to rank values in table based on column you want.

Step 2 : Create another measure M2 =IF(M1<=5,1,0)

Step 3 : Now in a table values,use conditional formatting based on M2

 

View solution in original post

3 REPLIES 3
v-piga-msft
Resident Rockstar
Resident Rockstar

Hi @nish2288,

 

Have you solved your problem by the solution provided by @Greg_Deckler?

 

If you have solved, only thing that you'll have to notice, just always accept the replies making sense as solution to your question so that people who may have the same question can get the solution directly.

 

If you still need help, please describe your scenario in more details and share your expected output, so that we can help further investigate on it?

 

Best Regards,

Cherry

Community Support Team _ Cherry Gao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I was able to find the solution for this.

 

Solution:

Step 1:  Create measure(M1)and use RANKX function to rank values in table based on column you want.

Step 2 : Create another measure M2 =IF(M1<=5,1,0)

Step 3 : Now in a table values,use conditional formatting based on M2

 

Greg_Deckler
Community Champion
Community Champion

With the May version you can base the color coding on a measure or other column. So, perhaps a RANKX measure but I would need to understand your data and how you are presenting it to be more specific.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.