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

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

Reply
rampsaladi
Frequent Visitor

Dynamically Calculating Rank based on Slicer

I have the following sample Dataset and I need to be able to rank the SKU based on the $ Amount for a specific time period and product combination. The user wants to see ranks for multiple time periods but these need to change based on Product selection as a slicer. Below is the data. Any help would be appreciated

 

Time PeriodProductsSKU$ Amount
Last 4 WeeksAAA1
Last 4 WeeksAAB3
Last 4 WeeksAAC0.5
Last 4 WeeksBBA2
Last 4 WeeksBBB1
Last 4 WeeksBBC6
Last 16 WeeksAAA3
Last 16 WeeksAAB4
Last 16 WeeksAAC1
Last 16 WeeksBBA4
Last 16 WeeksBBB6
Last 16 WeeksBBC7
1 ACCEPTED SOLUTION

@rampsaladi

 

Rank =
RANKX (
    ALLSELECTED ( TableName ),
    CALCULATE ( SUM ( TableName[$ Amount] ) ),
    ,
    DESC,
    DENSE
)

View solution in original post

3 REPLIES 3
Rfranca
Resolver IV
Resolver IV

 

hi, @rampsaladi

rankn = RANKX(ALL(tabela[Time Period];tabela[Products];tabela[SKU]);[TT_Amount];;ASC;Dense)

@rampsaladi

 

Rank =
RANKX (
    ALLSELECTED ( TableName ),
    CALCULATE ( SUM ( TableName[$ Amount] ) ),
    ,
    DESC,
    DENSE
)

Thank you this helps

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.