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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
NaveenMD
Helper I
Helper I

Ranking each cell in column from conditional formatting

What I am trying to achieved is column value based conditional formatting ie. if my value in cell 1 > value in cell 2 then  cell 1 should be in darker shade.

 

I believe this can be easily implemented if I rank the values in the matrix.

 In my specific usecase the values in the rows (ie. row labels)  will be filtered using filters option in power BI so the dax should act accordingly.

NaveenMD_1-1709023247816.png

 

 

This is a test table that has been created.

 

The table on the left has values  which can be ranked as shown in table on the ringht.

 

 

 

NaveenMD_0-1709023218483.png

@amitchandak @Daniel29195  please support

5 REPLIES 5
Daniel29195
Super User
Super User

@NaveenMD 

use 

rankx  and allselected() function .

 

measure_sales amount = 

sales amount = sum(tbl_name[col_name]) 

 

measure rank = 

rankx  ( allselected ( tbl_name[col_name] )  , [sales amount] ,  asc ) 

 

 

hope this helps .

 

NB :  the idea is to use allselected () so that the rankx act according to your filters .

change the tbl_name and col_name with your appropriate names  from your model .

 

 

If my answer helped sort things out for you, i would appreciate a thumbs up 👍 and mark it as the solution
It makes a difference and might help someone else too. Thanks for spreading the good vibes! 🤠

tried this all values become 1

NaveenMD_0-1709027365249.png

 

@NaveenMD 

did you use  allselected  on the colummn having the values  A,B,C,D ...  ? 

mix rank =

var val = SUM(SMS[Mix Actual])
var final = RANKX(ALLSELECTED(SMS[Particulars]),val,,ASC)
RETURN
final

yes

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors