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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
o59393
Post Prodigy
Post Prodigy

Rankx not displaying ranking properly

Hi all

 

I am using a the rankx dax fucntion to rank a colum called ingredient 1 volume.

 

This value leaves within a table called Query1.

 

The dax is:

 

 

 

Rank dax = RANKX(ALL(Query1), [Ingredient 1 volume dax])

 

 

 

When I drag the metric the ranking will look like this:

 

ranking.png

 

As seen the ranking is not displaying properly. So my question is, how can I write the dax in order to isolate the rest of variables?

 

Should I get rid of the ALL function and its reference to the table Query?

 

I just want to rank the ingredient 1 column with whatever filter (year, country for example) I apply.

 

Thanks.

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @o59393 ,

 

We can use the following measure to resolve it.

 

Rank DAX =
RANKX (
    CALCULATETABLE ( DISTINCT ( 'Query1'[Merged] ), ALLSELECTED ( Quey1 ) ),
    CALCULATE ( [Ingredient 1 volume dax] ),
    ,
    DESC,
    DENSE
)

 

If it doesn't work, could you please show formula of [Ingredient 1 volume dax] if it does not contain any confidential information?


Best regards,

 

Community Support Team _ Dong Li
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

4 REPLIES 4
v-lid-msft
Community Support
Community Support

Hi @o59393 ,

 

We can use the following measure to resolve it.

 

Rank DAX =
RANKX (
    CALCULATETABLE ( DISTINCT ( 'Query1'[Merged] ), ALLSELECTED ( Quey1 ) ),
    CALCULATE ( [Ingredient 1 volume dax] ),
    ,
    DESC,
    DENSE
)

 

If it doesn't work, could you please show formula of [Ingredient 1 volume dax] if it does not contain any confidential information?


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Can I add a filter condition to this   measure? 

Thanks for the help @v-lid-msft and @Anonymous  it's perfect:

 

rank111.PNG

Regards.

 

Anonymous
Not applicable

Hi @o59393 ,

 

1. Is your [Ingredient 1 volume dax] a measure? If yes, could you please show it?

2. Could you please show me your data model?

 

Because I tried it on my desktop, it works.

 

Thanks.

Aiolos Zhao

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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