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

TopN with Multiple Dimensions

Hi there clever people!

 

I have a ranking situation that I am trying to solve and have approached it from 5 different ways and reach the same result every time, so I may be about to go insane.  Hopefully, someone can help!

 

I am trying to Rank the Top 5 retail stores by WOS (weeks of Supply) using TopN (but I have tried Rankx as well without success) that is a simple calculation of average stock on hand divided by the average sales over the past 4-weeks.

 

The initial ranking works well (I can see the top 5 stores) but it falls apart when I bring in a second dimension.

 

I need to see the weeks of supply for these top 5 stores with the associated product price tier, however, as soon as I add the price tier to the visual I get other stores too because it pulls in the top 5 price tiers.

 

The model can be found here: https://drive.google.com/file/d/1vnNplHUeSV2o19D08bFDou6EBoPNxyjO/view?usp=sharing

 

Please let me know if you need more information to help.

 

Many thanks

 

Phil

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Here's the solution.

 

Best

D

View solution in original post

Anonymous
Not applicable

Well, my solution has the advantage that it can be used in ANY visual and restrict stores even if other measures used in there return values for all stores.

Best
D

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Here's the solution.

 

Best

D

Anonymous
Not applicable

Thank you very much, D

 

I also got the following solution from another site that worked well too:

 

Rank Stores = VAR Top5Stores = CALCULATETABLE ( TOPN ( 5, CALCULATETABLE ( VALUES ( Locations[Store Name] ) ), [Weeks of Sales] ), ALLSELECTED() ) RETURN CALCULATE ( [Weeks of Sales], KEEPFILTERS ( Top5Stores ) )

 

Cheers,

 

Phil

 

Can you share the website where you got this solution?

Anonymous
Not applicable

Well, my solution has the advantage that it can be used in ANY visual and restrict stores even if other measures used in there return values for all stores.

Best
D

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.

Top Solution Authors