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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Anonymous
Not applicable

Dynamic Ranking using Rank X

I am for some reason having issues with implementing Rank X. For some reason it won't do the simple task of ranking based on a given column or column hiearchy attached with a value.

For example lets say I have a table called Products where it contains the columns: Product, Life Stage, Category, and Value.

The hiearchy goes where Each product has x amount of Life Stages and each Life Stage has x amount of Categories where they all have a value.

I was wondering if it is possible to have a ranking function to where it will rank them based on what row is given. For example, I could have it where it is just the Product column as the row and it ranks like this 

alzwang99_0-1721232216152.png

Or I can have it where I add in Life stage afterwards and it is ranked like this 

alzwang99_1-1721232252959.png

Or adding the categories

alzwang99_2-1721232287332.png


Or even have it where maybe I only want to know the ranking inbetween Life stages or just inbetween Categories

alzwang99_3-1721232331712.png

 

The solutions I have found online so far hasn't worked for me.

For example writing 

Dynamic Ranking =
RANKX(
    ALLSELECTED('EBSKU Simplified'),
    [AggregateValue],
    ,
    DESC,
    Dense
)
does not work for me.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your statement, your rank is calcualted base on specific columns in your visual. As far as I know, currently Power BI doesn't support us to create a rank measure dynamiclly to show results as you want.

I suggest you to try create different rank measures based on different situation.

Rank for Product = RANKX(SUMMARIZE(ALLSELECTED('Table'),'Table'[Product]),[M_Value])
Rank for Lifestafe = RANKX(SUMMARIZE(ALLSELECTED('Table'),'Table'[Lifestage]),[M_Value])
Rank for Category = RANKX(SUMMARIZE(ALLSELECTED('Table'),'Table'[Category]),[M_Value])
Rank for P & L = RANKX(FILTER(SUMMARIZE(ALLSELECTED('Table'),'Table'[Product],'Table'[Lifestage]),'Table'[Lifestage] = MAX('Table'[Lifestage])),[M_Value])

Result is as below.

vrzhoumsft_0-1721272944021.png

 

Best Regards,
Rico Zhou

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

 

According to your statement, your rank is calcualted base on specific columns in your visual. As far as I know, currently Power BI doesn't support us to create a rank measure dynamiclly to show results as you want.

I suggest you to try create different rank measures based on different situation.

Rank for Product = RANKX(SUMMARIZE(ALLSELECTED('Table'),'Table'[Product]),[M_Value])
Rank for Lifestafe = RANKX(SUMMARIZE(ALLSELECTED('Table'),'Table'[Lifestage]),[M_Value])
Rank for Category = RANKX(SUMMARIZE(ALLSELECTED('Table'),'Table'[Category]),[M_Value])
Rank for P & L = RANKX(FILTER(SUMMARIZE(ALLSELECTED('Table'),'Table'[Product],'Table'[Lifestage]),'Table'[Lifestage] = MAX('Table'[Lifestage])),[M_Value])

Result is as below.

vrzhoumsft_0-1721272944021.png

 

Best Regards,
Rico Zhou

 

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

 

Anonymous
Not applicable

Hi Rico,

While I do find it unfortunate that that is the case, I appreciate you providing the workaround it. 

I guess I thought PowerBi would have those capabilities, but there is still room for it to grow.

Thank you.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors