Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi mates,
I have three columns, "Company", "COuntry" and "ValueX".
I want to rank a company (by using a filter) base on "ValueX" within a selection of countries (another filter). I used the DAX as below with the purpose to keep the country filter and remove the company filter. However, it returns the rank of that company in ALL countries 😞
Ranking = RANKX(ALLEXCEPT(Geography,Geography[Country]),[ValueX],,ASC,Skip)
Please help.
Thank you so much in advance.
Hi @CNENFRNL , thank you so much for you reple. But I cant still get you quite clearly. Could you please advise me what should I do in this case?
Hi, @Anonymous , I listed a direct reason that your measure returns the rank of that company in ALL countries; ALLEXCEPT(Geography,Geography[Country]) here is used as a table function, it returns Geography table without column [Country]; natually the filter on Geography[Country] is gone with the wind...
Without a close look at your data model, I could do nothing but to make a guess at my best,
Ranking = RANKX ( ALLSELECTED ( Geography[Country] ), [ValueX],, ASC, SKIP )
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi, @Anonymous , ALLEXCEPT(T, C1, C2...) is tricky,
1. 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;
2. When used as a modifier in CALCULATE or CALCULATETABLE, ALLEXCEPT removes the filters from the expanded table specified in the first argument, keeping only the filters in the columns specified in the following arguments.
You might to refer to the link for more details.
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the September 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
15 | |
11 | |
10 | |
10 |