The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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