Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

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!!

 

 

 

2 Replies