Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

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

 

one.pngtwo.png

 

 

1 ACCEPTED SOLUTION
v-yulgu-msft
Employee
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

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yulgu-msft
Employee
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

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Can someone please help me with the posted question. 😞 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.