Forum Discussion

tracyhopaulson's avatar
tracyhopaulson
Resolver I
4 years ago
Solved

Top N Ranking for specific year

I have a list of customers and need to rank by 2021 sales.  When using Top N function, it ranks by total sales of all years.  Is there a work around to rank sales for specific year?  Thanks     ...
  • TheoC's avatar
    4 years ago

    Hi tracyhopaulson, you can create a rank by category through a Calculated Column that will provide you with a ranking for each Customer by their respective Total Value for each Year.  You can then simply filter out Year column to 2021 by "Fitler Type" in the Filters Pane of the visual.  Hope this helps 🙂 (FYI - I called the table "t_Rank" so you will need to adjust yours accordingly 🙂 )

     

    Also, an alternative is to use a Slicer / Filter visual with Years so that you can let the user choose the Year and show the rank accordingly 🙂

     

    Just in addition to the above, I recently put together a solution for dynamic ranking for visuals. This may be of benefit to you as well: https://community.powerbi.com/t5/Desktop/Sort-Legend-Dynamically-By-its-Value/m-p/2112139#M782542