Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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?
User | Count |
---|---|
93 | |
83 | |
77 | |
73 | |
66 |
User | Count |
---|---|
115 | |
104 | |
93 | |
64 | |
61 |