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
Sage2019
Frequent Visitor

RANKX not working when slicer selection is made

Hi , I am trying to create a rank measure that ranks a list of items based on their ID which is unique and incremented. However, the RANK Measure num is repeated for all items when a selection is made in the slicer. How can I fix this? 

rank measure = RANKX(ALLSELECTED(cars),calculate(SUM(cars[carID])),,ASC)

Sage2019_0-1704815278599.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Sage2019 

 

I followed your method to create the following table and measure formula, which works fine on my Power BI desktop

vjialongymsft_0-1704866867753.png

rank measure = RANKX(ALLSELECTED(cars),calculate(SUM(cars[carID])),,ASC,Dense)

vjialongymsft_1-1704866911164.pngvjialongymsft_2-1704866919845.pngvjialongymsft_3-1704866927797.png

 

 

 

If you don't want your rank measure to change with your slicer selection, you can try using the following DAX

Rank Measure1 = 
RANKX(
    ALL(cars), 
    CALCULATE(SUM(cars[carID])),
    ,
    ASC,
    DENSE
)

vjialongymsft_4-1704867185425.png

 

 

 

Best Regards,

Jayleny

 

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

1 REPLY 1
Anonymous
Not applicable

Hi @Sage2019 

 

I followed your method to create the following table and measure formula, which works fine on my Power BI desktop

vjialongymsft_0-1704866867753.png

rank measure = RANKX(ALLSELECTED(cars),calculate(SUM(cars[carID])),,ASC,Dense)

vjialongymsft_1-1704866911164.pngvjialongymsft_2-1704866919845.pngvjialongymsft_3-1704866927797.png

 

 

 

If you don't want your rank measure to change with your slicer selection, you can try using the following DAX

Rank Measure1 = 
RANKX(
    ALL(cars), 
    CALCULATE(SUM(cars[carID])),
    ,
    ASC,
    DENSE
)

vjialongymsft_4-1704867185425.png

 

 

 

Best Regards,

Jayleny

 

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

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