cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
tracyhopaulson
Resolver I
Resolver I

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

 

 

ranking.JPG

 

 

 

 

1 ACCEPTED SOLUTION
TheoC
Memorable Member
Memorable Member

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 🙂 )

 

TheoC_0-1633581389736.png

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 🙂

TheoC_1-1633581479078.png

 

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

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?  www.linkedin.com/in/theoconias

View solution in original post

3 REPLIES 3
TheoC
Memorable Member
Memorable Member

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 🙂 )

 

TheoC_0-1633581389736.png

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 🙂

TheoC_1-1633581479078.png

 

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

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?  www.linkedin.com/in/theoconias

View solution in original post

Thank you 🙂

amitchandak
Super User
Super User

@tracyhopaulson , create a measure like this and create rank on that

meausre = calculate(sum(Table[sales]),Table[Year]=2021)

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!

Helpful resources

Announcements
Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors