Forum Discussion
Vivek26
Advocate I
1 year agoRankx Not working as expected when data is filtered using slicers and filter pane
I am facing a challenge with Rankx implementation. When I use slicers to filter certain dimensions the rankx starts behaving incorrectly The dataset/Datamodel is very simple, We have 3 tables ...
- Anonymous1 year ago
Hi Vivek26
Please check this measure. Although it is not concise enough, it seems to meet your requirements.
rank = var currentDistrict = SELECTEDVALUE(Store[District]) var sumTable = SUMMARIZE(ALLSELECTED(Store),Store[Region],Store[District],"Total_Amount",[Total Sales]) var rankTable = ADDCOLUMNS(sumTable,"Rank_Value",RANK(DENSE,sumTable,ORDERBY([Total_Amount],DESC))) return MAXX(FILTER(rankTable,[District] = currentDistrict),[Rank_Value])I struggled a lot but haven't figured out a method with RANKX yet. Hope this would be helpful.
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
Vivek26
Advocate I
1 year agopowerbiexpert22 . Thanks for replying.
I used your pbix but instead of having 3 different slicers . I used a single one and I started getting the same issue.
My Apoligies I should have clarified my usage of slicer
- powerbiexpert221 year ago
Impactful Individual
Hi Vivek26 ,
try to use below
rank =RANKX(ALLSELECTED(store[region],store[district],store[storeid]),[Total Sales],,DESC,Dense)