Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
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:
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.
Solved! Go to Solution.
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,
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,
Can I add a filter condition to this measure?
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
80 | |
76 | |
60 | |
36 | |
33 |
User | Count |
---|---|
91 | |
60 | |
59 | |
49 | |
45 |