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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

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
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.