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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
)

Regards
Zubair

Please try my custom visuals

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
)

Regards
Zubair

Please try my custom visuals

Thank you this helps

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.