Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hi I am running into a wall trying to figure out how to have Rankx to work with filters.
Rankx is currently working correctly on the full table (Table 1 below) using:
Rank = RANKX(
Summarize(ALLSELECTED('CustomerTbl'), 'CustomerTbl'[CustomerName]),
[Sales]
,,DESC
)
However, when I use the Customer filter I am getting strange rank results (see Table 2 below). I am using DQ so cannot provide dummy data, but any ideas, suggesions would be appreciated.
Hi @cjcj
this can help you out
https://www.youtube.com/watch?v=pM_8zsPidRk&t=731s
https://www.youtube.com/watch?v=aMbtfBzTtBc&t=780s
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
hi @aj1973 , inscope did not yield any different resuts and unfortunately I cannot leverage video 2 for adding columns since I am on Direct Query.
Hi @cjcj ,
From the test in myside, I think you issue should be caused by [Sales] measure or your data model.
My Sample:
Result is as below.
In my sample I use sum to get sales value without any filter. Please check the calculation logic of your measure.
If this still couldn't help you solve your issue, please show me more details about your data model and your calculation logic.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@cjcj , if you do want rank to change then you can use all , try if that can help
Rank = RANKX(
Summarize(ALL('CustomerTbl'), 'CustomerTbl'[CustomerName]),
[Sales]
,,DESC
)
thx for the suggestion @amitchandak I tried Summarize(All..and the ranking is correct when I apply to Table 1(with all customers), but not correct under Table 2 with customer filter applied to just 1 customer. Wondering if the problem is occuring due to customer filter being a dim table?
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 21 | |
| 20 | |
| 19 | |
| 13 |
| User | Count |
|---|---|
| 58 | |
| 52 | |
| 37 | |
| 31 | |
| 27 |