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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
becha77
New Member

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 2
becha77
New Member

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

ThxAlot
Super User
Super User

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.


Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.