How to Get Top 5 in Tableau
One of the most common requests in data analysis is to isolate your top performers - whether it's your top 5 products, top 10 salespeople, or top 3 marketing channels. Cutting through the noise to see what's working best is essential. This article will show you several ways to calculate and display the Top 5 in Tableau, starting with the simplest filter and moving to more flexible and dynamic methods.
Why Isolate Your "Top N" Performers?
Analyzing your "Top N" - where N can be 5, 10, or any number you choose - is a fundamental practice in business intelligence for a few key reasons. It immediately helps you simplify complex datasets, making them easier to understand at a glance. Instead of looking at a list of 1,000 products, focusing on the Top 5 lets you spot trends and patterns among your most important items.
This focus allows for better decision-making and resource allocation. For example, by identifying your:
- Top 5 selling products: You know which items to keep in stock, feature in marketing, or analyze to understand their success.
- Top 5 sales representatives: You can recognize high achievement, learn from their strategies, and create mentorship opportunities.
- Top 5 marketing campaigns by ROI: You know where to double down on your advertising budget for the best returns.
Filtering for the 'best of the best' helps you move from raw data to actionable insights quickly. Now, let's look at how to actually do it in Tableau.
Free PDF Guide
AI for Data Analysis Crash Course
Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.
Method 1: The Quick and Easy Filter Method
This is the most direct way to get a Top 5 list. It's perfect for quick, one-off analyses where you don't need the list to be interactive or used elsewhere in your workbook.
Let's imagine you have a bar chart showing Sales by Sub-Category, and you want to narrow it down to the top 5 highest-grossing sub-categories.
Step-by-Step Instructions:
- Build your initial view: Drag the dimension you want to rank (e.g.,
Sub-Category) to theRowsshelf and the measure you want to rank by (e.g.,Sales) to theColumnsshelf. - Add the filter: Drag the
Sub-Categorydimension from the Data pane directly onto theFiltersshelf. A dialog box will pop up. - Configure the Top filter: In the dialog box, navigate to the Top tab.
- Apply the filter: Click OK. Your view will immediately update to show only the top 5 sub-categories based on their total sales. We also recommend sorting your view descending to see the rankings clearly.
Pros: This method is incredibly fast and intuitive. It takes just a few clicks to implement and is easy for beginners to understand.
Cons: The filter is static. If you want to change it to a Top 7 or a Bottom 5, you have to manually go back in and edit the filter. It's less flexible for dashboards where you might want the user to control the ranking.
Method 2: Using a Set for More Flexibility
Sets are a fantastic feature in Tableau that let you group members of a dimension. Creating a set for your Top 5 gives you a reusable element you can apply to multiple worksheets or use within calculated fields.
Using the same Sales by Sub-Category example:
Step-by-Step Instructions:
- Build your initial view: Just like before, create a bar chart with
Sub-CategoryonRowsandSalesonColumns. - Create the Set: In the Data pane on the left, find your dimension (
Sub-Category). Right-click on it and select Create > Set. - Configure the Set: A dialog box will appear.
- Use the Set as a filter: Click OK. You'll now see your new set in the Data pane. Drag this set onto the
Filtersshelf. Your view will now be filtered to the Top 5 members you defined. The members in the set (the Top 5) are shown as "In", and all others as "Out".
Pros: Sets are reusable. You can drag the same "Top 5 Sub-Categories" set to other charts. You can also use them in calculations to compare the "In" group to the "Out" group (e.g., to create an "All Others" category).
Cons: Just like the simple filter, the number ("5") is hardcoded. It is still not interactive for the end-user out of the box.
Method 3: Advanced Control with the INDEX() Function
For the ultimate control over ranking and sorting, table calculations are the way to go. The INDEX() function assigns a number (1, 2, 3...) to each row in your partition, which effectively acts as a rank. This method is particularly useful when ranking is dependent on other table calculations.
Step-by-Step Instructions:
- Build your view and sort it: Create your chart with
Sub-CategoryonRowsandSalesonColumns. Crucially, you must click the sort icon to sort the chart descending bySUM(Sales). The ranking depends on the sort order. - Create the INDEX() Calculation:
- The formula is simply:
- Add the Rank to your view (for checking): Drag your new
Rankcalculation to theRowsshelf, right before yourSub-Categorypill. Right-click theRankpill and change it to Discrete. You will now see numbers 1, 2, 3, etc., next to each sub-category, confirming your ranking is working as expected. - Filter by Rank: Now, drag the
Rankcalculated field (this time from the Data pane) onto theFiltersshelf. A dialog box will pop up. - Define the range: In the filter options box, select a range of values. A good choice is to set the maximum to 5. This tells Tableau to only keep rows where the Rank is 5 or less. Click OK.
Pros: This method gives you precise control over your filtering and works well in complex views with other table calculations. The RANK(), RANK_UNIQUE(), and other ranking functions offer even more nuanced ways to handle ties.
Cons: It's slightly more complex to set up. You have to be mindful of sorting and how the table calculation is being computed (its direction and scope, which can be edited via "Edit Table Calculation").
Bonus Pro Tip: Making Your Top N Dynamic with a Parameter
This is where your dashboards go from static to interactive. By combining a Parameter with a Set or a Rank calculation, you can let your audience decide if they want to see the Top 3, Top 5, or Top 10.
Let's adapt our Set method (Method 2) to build this.
Free PDF Guide
AI for Data Analysis Crash Course
Learn how to get AI to do data analysis for you — the best tools, prompts, and workflows to go from raw data to insights without writing a single line of code.
Step-by-Step Instructions:
- Create a Parameter:
- Connect the Parameter to your Set:
- Show the Parameter control: In the Data pane, find the "Select Top N" parameter, right-click on it, and choose Show Parameter.
A new control (a slider or a text box) will appear in your view. Now, when a user changes the value from 5 to 10, the view updates instantly to show the Top 10. This creates a much more engaging and user-driven experience.
Final Thoughts
You now have four solid methods for finding and visualizing Top N results in Tableau. The simple filter is great for quick analysis, while Sets, Index(), and Parameters unlock a greater degree of control, reusability, and interactivity for your dashboards. Choosing the right method depends on whether you need a quick static chart or a flexible, user-driven analysis.
Ultimately, these techniques are all about saving time and getting to insights faster. Here at our company, we built Graphed because we believe the path from data to decision should be as short as possible. Instead of spending hours learning calculation syntax or clicking through menus to create interactive filters, you can just ask in plain English: "Show me a chart of our top 5 products by sales" and get a live, interactive visualization in seconds. We automate the manual report-building so you can spend less time wrangling your tools and more time analyzing what your data is telling you.
Related Articles
Facebook Ads for Gyms: The Complete 2026 Strategy Guide
Master Facebook advertising for your gym in 2026. Learn the proven 6-section framework, targeting strategies, and ad formats that drive memberships.
Facebook Ads for Home Cleaners: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for home cleaners in 2026. Discover the best ad formats, targeting strategies, and budgeting tips to generate more leads.
Facebook Ads for Pet Grooming: The Complete 2026 Strategy Guide
Learn how to run Facebook ads for pet grooming businesses in 2025. Discover AI-powered creative scaling, pain point discovery strategies, and the new customer offer that works.