cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

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

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: TopN with Multiple Dimensions

Here's the solution.

 

Best

D



Have I answered your question?
Please mark my post as the solution.


Please don't forget your Kudos if you don't mind. Thanks.


View solution in original post

3 REPLIES 3
Highlighted
Super User IV
Super User IV

Re: TopN with Multiple Dimensions

Here's the solution.

 

Best

D



Have I answered your question?
Please mark my post as the solution.


Please don't forget your Kudos if you don't mind. Thanks.


View solution in original post

Highlighted
Frequent Visitor

Re: TopN with Multiple Dimensions

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

 

Highlighted
Super User IV
Super User IV

Re: TopN with Multiple Dimensions

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


Have I answered your question?
Please mark my post as the solution.


Please don't forget your Kudos if you don't mind. Thanks.


Helpful resources

Announcements
Community Blog

Community Blog

Visit our Community Blog for articles, guides, and information created by fellow community members.

Using the Community

Using the Community

Need help with the Power BI Community? Our 'Using the Community' support articles are a great place to start.

Galleries

Galleries

Looking for inspiration on how to present your data? Need instructional videos? Check out our Galleries!

Community Summit North America

Community Summit North America

Innovate, Collaborate, Grow. The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors