How to Get Top 10 Records in Tableau
Showing the top 10 best-performing items in your dataset is one of the quickest ways to find meaningful insights. Whether you want to see your most popular products, top sales reps, or best-performing ad campaigns, filtering for the "Top 10" helps you immediately focus on what’s working. This article will show you three clear, practical methods to get the top 10 records in Tableau, from a simple drag-and-drop filter to a more advanced and dynamic approach.
Why Isolate the Top 10?
Before jumping into the “how,” it’s helpful to understand the “why.” The concept often traces back to the Pareto Principle, also known as the 80/20 rule. In many businesses, a small number of inputs produce the majority of outputs. For example:
- Roughly 20% of your products might account for 80% of your sales revenue.
- A small group of your most loyal customers could be responsible for most of your repeat business.
- A few high-performing marketing channels often drive the bulk of your website traffic and conversions.
By filtering your data down to the top 5, 10, or 20 records, you can quickly identify these high-impact players. This allows you to focus your energy where it matters most - promoting bestselling products, nurturing your best customers, or doubling down on profitable marketing channels.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Method 1: Using a Basic Top N Filter
This is the quickest and most straightforward way to show your top 10 records in Tableau. It’s perfect for fast analysis when you don't need the filter to be interactive for your end-users.
Let's use the classic Tableau Superstore dataset as an example. Our goal is to find the top 10 best-selling products.
Step-by-Step Instructions:
- Set Up Your View: First, create a basic bar chart. Drag the
Product Namedimension from the Data pane onto the Rows shelf. Then, drag theSalesmeasure onto the Columns shelf. You'll see a long list of products and their sales. For clarity, click the sort button in the toolbar to arrange them in descending order. - Drag the Dimension to the Filters Card: Hold down the CTRL key and drag a copy of
Product Nameinto the Filters card. This keeps everything organized and allows you to apply a quick filter effectively. - Configure the Top N Filter: A "Filter" dialog box will appear. You'll see several tabs at the top (General, Wildcard, Condition, Top). Click on the Top tab.
- Define Your Filter Logic:
- Apply the Filter: Click OK.
Your bar chart will immediately update to show only the 10 products with the highest total sales. This method is incredibly fast and intuitive, making it a favorite for many analysts performing routine checks.
Method 2: Using the INDEX() Function for Ranks
Sometimes you need more control, especially when working with more complex visualizations or wanting to show the rank number itself (1, 2, 3, etc.) next to each record. For this, a table calculation like INDEX() is a better tool. It calculates the position (index) of the current row in the view.
Step-by-Step Instructions:
- Set Up the Initial View: Once again, place
Product Nameon the Rows shelf andSUM(Sales)on the Columns shelf, then sort it descendingly. - Create a Calculated Field:
- Add the Rank to Your View: Drag your new
Rankfield from the Measures pane onto the Rows shelf and place it to the left ofProduct Name. You’ll see that it's a green pill, meaning Tableau is treating it as a continuous measure. - Convert Rank to Discrete: Right-click the
Rankpill and select Discrete. The pill will turn blue, and you'll now see a rank number (1, 2, 3...) next to each product name. - Filter by the Rank: Now, drag the blue
Rankpill from the Rows shelf over to the Filters card. A "Filter Field" dialog box will appear. Enter a range from 1 to 10 and click OK.
Your view is now filtered to the Top 10 records, but this time you have a visible rank column. The benefit of this method comes from its interaction with Tableau's order of operations. Table calculation filters (like this one) are applied late in the pipeline, which gives you more control over the final result in complex vizzes.
Method 3: Creating a Dynamic Top N with a Parameter and Set
This is the most powerful and flexible method. It allows you or your audience to dynamically change the "N" value in "Top N" - for instance, switching from Top 10 to Top 5 or Top 20 on the fly right from the dashboard view.
This method involves two key Tableau features: Parameters (user-driven inputs) and Sets (custom subsets of your data).
Step 1: Create a Parameter
First, we need to create a control that lets the user input a number.
- In the Data pane, click the little dropdown arrow in the top right and select Create Parameter.
- Name your parameter. Let’s call it
Top N Value. - Set the Data type to Integer.
- For Current value, enter 10 as a default.
- Under Allowable values, you can select "All" or define a specific "Range" (e.g., from 1 to 50) to prevent users from entering invalid numbers.
- Click OK. You'll now see the
Top N Valueparameter at the bottom of the Data pane.
Step 2: Create a Set That Uses the Parameter
Next, we will create a Set of products, but instead of hardcoding "10", we'll link it to our new parameter.
- In the Data pane, find the dimension you want to rank. In our case, it's
Product Name. - Right-click on
Product Nameand select Create > Set. - Name the set something descriptive, like
Top Products by Sales Set. - Just like in the first method, navigate to the Top tab and select By field.
- Now for the magic part: where it asks for the number of records (it defaults to 10), click the dropdown menu next to it. You will see your newly created parameter,
Top N Value. Select it. - Make sure the remaining fields are set correctly (By
Sales, using the Sum aggregation). - Click OK.
Free PDF · the crash course
AI Agents for Marketing Crash Course
Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.
Step 3: Use the Set as a Filter
- Create your worksheet as before (
Product Nameon Rows,SUM(Sales)on Columns). - Find your new
Top Products by Sales Setin the Sets section of the Data pane. - Drag this set directly onto the Filters card.
That's it! Your view is now filtered. To make it interactive, right-click on the Top N Value parameter in the Data pane and select Show Parameter. A small control box will appear on your dashboard, allowing anyone to type in a number and watch the view instantly update to show the Top 5, Top 15, or whatever "N" they choose.
Which Method Should You Use?
Choosing the right method depends on your goal:
- The Basic Top N Filter is perfect for quick, one-off analyses in a single worksheet where you don't need user interactivity. It's the fastest way to get an answer.
- The INDEX() Function gives you more control over calculations and the ability to display the rank. It's best when the rank itself is an important piece of the story you're telling.
- Sets and Parameters are the gold standard for creating user-friendly, interactive dashboards. If you're building a report for others to consume, this method empowers them to explore the data on their own terms.
Final Thoughts
Learning how to filter for your top records is a fundamental skill in Tableau that can unlock powerful insights quickly. Whether you opt for the simple drag-and-drop filter, a calculated rank, or a dynamic parameter, focusing on your top performers helps direct your attention and resources more effectively.
Building dashboards in BI tools often requires learning different methods, calculated fields, and configurations for what seems like a simple task. This is why we created Graphed. Instead of navigating menus to create sets and parameters, you can simply ask a question like, "Show me my top 10 products by revenue last quarter" and get an interactive chart in seconds. We automate the technical setup, allowing you to get answers and move on to the next big question without getting stuck on the process.
Related Articles
How to Create Facebook Ads API for Claude Code
Create a Meta Marketing API access token that never expires, using a system user, so Claude Code can pull Facebook ad reports and manage campaigns.
ClickHouse vs Postgres: When to Switch to Columnar
Comparing ClickHouse vs PostgreSQL means matching storage architecture to workload. Row storage wins for transactions. Columnar wins for scan-heavy analytics.
Google Ads for Orthodontists: Get More Booked Consults
Most orthodontic Google Ads campaigns waste money on low-intent searches. The problem is structure, not the platform.