Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have a table with a list of countries and GDP per capita:
To try to understand the RANKX function, I added a calculated column with the following fuction:
Coluna = RANKX('Indicadores económicos';'Indicadores económicos'[PIB per capita];;ASC;Dense)
I've read the DAX reference manual for this function and searched all over but can't figure out what the "value" argument is supposed to do...
Can someone please explain what this is?
Thank you so much!
Solved! Go to Solution.
You can take a look at the last part of this blog. It explains how rankx works when we specific the third value argument.
Best Regards,
Herbert
You can take a look at the last part of this blog. It explains how rankx works when we specific the third value argument.
Best Regards,
Herbert
Bizarre... but thanks, I think I understood...
The <value> argument is ranked over the values returned by the <expression for every row of the table. if value argument is ignored, expression is instead used to compute the value for ranking in the evaluation context that is calling the RANKX function.
The expression argument is using the row context while value argument may or may not use row context and is solely depends on caller of the RANKX function.
As you probably would know, CALCULATE transforms the current row context into the filter context and can be used in RANKX function.
By default, the value argument corresponds to expression argument and this is a correct choice whenever you are ranking over a DAX measure or an aggrgation expression. However, if you want to perform a ranking over a table by the value of the one of the columns of the table itself, then you need to specify the different expression in a value argument.
The value argument defines the expression to evaluate for the each row of the table mentioned in the first argument. So that it is evaluted inthe row context and can access the value of any column of the table.
and you need to use VALUES function to pass the third argument.
Hope this has clarified your understanding.
-- Adopted from the The Definitive Guide to DAX by Marco Russo and Alberto Ferrari.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
104 | |
101 | |
79 | |
72 | |
64 |
User | Count |
---|---|
142 | |
108 | |
101 | |
81 | |
74 |