Forum Discussion

becha77's avatar
becha77
New Member
2 years ago

doubts understanding RANKX when used for a calculated column

assume a need to create calculated column in table Customer
we want a ranking of sales among customers belonging to a single country, in "a universe" of different countries; so we have a ranking made for different countries
the formulae edited is=
RANKX ( ALLEXCEPT (Customer, Customer[Country]), [measure sales] )
i am conscious there is an outer row context (automaticaly created just because we are creating a calc colum) and an inner row context (inside RankX; for building a virtual table of lookup values with the second argument: [measure sales] )....
can anybody please clearly explain what is the ALLEXCEPT function doing?
is it eliminating filter context for all the table except the Country?
or is it creating a table virtual witll all columns of table Customer except the column of Country?
how does the inner row context works? how does the outer row context works?
i have read and heard different opinions about AllExcept performance. Some people say that it is NOT creating a table (but it is eliminating filter sensitivity in all columns except the Country),
while others have stated that it does create a virtual table that does not have the (key field, i might add) Country column
if the latter is correct, for the vida of me ....i cannot fathom how is it possible for the RANKX to work...when the key field of Country is not present inside the virtual table
thanks to all and anyone who would like to share wonderful knowledge about these doubts o'mine
hope everyone is happy and safe. Best regards in advance

2 Replies

  • https://dax.guide/allexcept/

    When used as a table function, ALLEXCEPT materializes all the unique combinations of the columns in the table specified in the first argument that are not listed in the following arguments.
  • Could anyone else please try to reply the specific inquiry?
    i found the original reply helpful but shortcoming
    thanks anyone, and i dont mean to sound pedantic or grateful. Happy last month of 2k23