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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.