Forum Discussion
Rankx code help for top 10 sales using matrix visual
I want to see top 10 Sales, So this what I did : created measure a new measure;
Rank =
RANKX(
ALLSELECTED( 'Dim Product'[Style Number] ), [Sales Amt], ,
DESC,
Dense
)
And set visual level filter to select Rank less than or equal to 10.
And it is working fine when I use matrix this way
Next I want to add one more level called store name right after channel and show Top 10 sales by store in each channel.
I’m using the same Rank measure but it is not Ranking as I expect it to. Do I need to change the Dax ? Can I have Dax code that can be used for ranking by just channel and also ranks when I use store name In the rows.
Store name and channel name are from store dim, style number from product and sales amt from daily fact table.
Any help is appreciated. Thanks!!
Hi Anonymous,
To make dynamic rank to work in Matrix hierarchy with drill down, please refer to the method in this link: DAX – Ranking with Hierarchy Drill-Down. Due to the limitation of ISFILTERED function in such a scenario, I would suggest you use ISINSCOPE instead.
Best regards,
Yuliana Gu
2 Replies
- AnonymousNot applicable
Can someone please help me with the posted question. :(
- v-yulgu-msftMicrosoft Employee
Hi Anonymous,
To make dynamic rank to work in Matrix hierarchy with drill down, please refer to the method in this link: DAX – Ranking with Hierarchy Drill-Down. Due to the limitation of ISFILTERED function in such a scenario, I would suggest you use ISINSCOPE instead.
Best regards,
Yuliana Gu