What Types of Top Filters Can You Create in Tableau?

Cody Schneider

One of the most common requests in data analysis is to see the "top performers" - the top 10 products by sales, the top 5 best-performing ad campaigns, or the top 20 most engaged customers. In Tableau, this is handled using top filters, which allow you to quickly focus on the most significant data points. This article will walk you through creating everything from a simple Top 10 list to more dynamic and advanced filters that give you and your team deeper insights.

Creating a Basic Top N Filter

Let's start with the foundation: building a simple filter to show a specific number of top items based on a measure. "N" is just a placeholder for whatever number you choose (e.g., Top 10, Top 5, Top 25). For this example, let's use the classic Sample-Superstore dataset to find the top 10 customers by total sales.

  1. Set Up Your View: Start by creating a simple bar chart. Drag the Customer Name dimension to the Rows shelf and the Sales measure to the Columns shelf. You'll now have a long bar chart showing the total sales for every single customer.

  2. Apply the Filter: To narrow this list down, drag the Customer Name dimension from the Data pane onto the Filters shelf. This will open a new dialog box.

  3. Configure the Top Filter: Within this dialog box, you'll see several tabs at the top (General, Wildcard, Condition, Top). Click on the Top tab.

  4. Define the Criteria: You'll be presented with a few options.

    • Select the By field radio button.

    • The first dropdown defaults to "Top" and "10" – you can leave this as is to find your Top 10.

    • In the next dropdown, you need to tell Tableau how to rank the customers. Select Sales as the measure and make sure the aggregation is set to Sum. This tells Tableau to rank customers based on their total summed sales.

    Your configuration should read: Top 10 by Sales (Sum).

  5. See the Result: Click OK. Your view will instantly update to show only the 10 customers with the highest total sales. Sorting the chart in descending order makes it even easier to read.

That's it! You've successfully created your first top N filter. This same method works for finding the top products by profit, the top states by number of orders, or any other "top" view you need.

Making Your Filter Dynamic with a Parameter

A static "Top 10" list is useful, but what if one manager wants to see the top 5 and another wants the top 20? Constantly editing the filter is inefficient. This is the perfect use case for a parameter, which gives the end-user a control to change the number "N" themselves without ever opening a Tableau file. This makes your dashboard interactive and far more useful for your audience.

Step 1: Create the Parameter

First, we need to create the parameter that will let users choose the number.

  1. On the Data pane (the left-hand sidebar), click the small dropdown arrow next to the search bar and select Create Parameter.

  2. A configuration window will pop up. Let’s set it up:

    • Name: Give it a clear name like "Select Top N".

    • Data type: Set this to Integer since we'll be dealing with whole numbers.

    • Current value: Set a default number, like 10.

    • Allowable values: Select Range. This lets you define the limits.

      • Set a Minimum of 5.

      • Set a Maximum of 30.

      • Set the step size to 5. This means users can choose 5, 10, 15, 20, 25, or 30.

  3. Click OK. You'll now see your new parameter appear in the Parameters section at the bottom of the Data pane.

Step 2: Connect the Parameter to Your Filter

Now, we need to tell your Customer Name filter to use this parameter instead of the fixed number 10.

  1. Find the Customer Name pill on your Filters shelf. Right-click it and choose Edit Filter.

  2. Navigate back to the Top tab.

  3. Remember where you typed in "10"? Click on that number field. You’ll see a dropdown menu appear. Instead of a fixed number, choose your new parameter, Select Top N.

  4. The field's value will now be the parameter's name. Click OK.

Step 3: Show the Parameter Control

The final step is to make the parameter control visible so users can interact with it.

  1. Find the Select Top N parameter in the Data pane.

  2. Right-click it and select Show Parameter.

A slider or a text input box will appear on the right side of your worksheet. Now you (or any user viewing the dashboard) can move the slider or a text input dropdown, and the chart will dynamically update to show the top 5, 10, 15, or whatever number is selected.

Filtering for the "Bottom N" Items

Sometimes you need to find the opposite: your lowest performing items. Identifying bottom-performers is just as important as praising top-performers, as it can highlight products that need to be discontinued or sales regions that need more support. Tableau makes this easy.

The process is identical to creating a top N filter with one small change. When you configure the filter in the Top tab:

  • Simply switch the radio button selector from Top to Bottom. That's it.

You can use the same parameter-driven approach here too, allowing users to dynamically switch between viewing the top and bottom performers, or to choose how many they want to see.

Advanced Filtering of "Top N" within Categories Using Context Filters

This is where things get really interesting. What if your manager doesn't want the overall top 5 products, but instead wants to see the top 5 products for each product category? Creating the “old style” of Tableau is easy, but the result you’ll get is a chart that just shows the overall top 5 products, repeated in all product categories. This means it will show the five products that are global top-five performers, regardless of whether a particular product actually belongs in that category. That is neither helpful nor insightful!

This tells us that Tableau performs these calculations at a higher level than you might guess. Tableau first identifies the Top 5 overall products and then filters your view for them, which means any other chart filters are essentially ignored.

But we need the opposite. We want Tableau to first filter by a Product Category, and then find the top 5 products inside that category. This is exactly what context filters were designed for.

Let’s set this up:

  1. Start Fresh: Create a new sheet. Drag Category and Subcategory to the Rows shelf, and Sales to the Columns shelf. You'll see sales for all Subcategories within each Major Category.

  2. Add the 'Category' Filter: This is the group by which the filter will find the top values. In this case, each group is a product category. So, drag the Category Dimension to the Filters shelf. Select "furniture", and click OK. Now the list is narrowed slightly. We just have our furniture and furniture subcategories.

  3. Critical Step: Add to Context: This one action transforms your chart from wrong to insightful. Right-click the Category pill on the Filters shelf and select Add to Context. The pill will turn grey, indicating it’s an active context filter. Now Tableau processes your data in sequential steps. Rather than making one giant global calculation, Tableau first filters for the "Technology" category, and only after completing the calculations will Tableau perform any other additional actions - including your top N filter action. Now your top-N list for "Technology" subcategory will work as intended with no risk that products from "Office Furnishing" will sneak into your Technology report.

  4. Create the Top N Filter: Just as before, you’ll drag Sub-Category onto the Filters shelf and set it up as a "Top 5" filter based on Sum of Sales. Because the category is “in context," Tableau will execute this rule by first narrowing down your product database to your “Furniture” products and then creating a list ordered by Sum of Sales in descending order. Without the extra step to place the dimension in-context, it will appear that some categories have fewer than five products because the products may not have made the global Top 5, even when they were still among the best sellers within their individual product categories.

You’ll now have a product and sales chart on your screen that is perfectly constructed, showing just the Top 5 best sellers within furniture. The chart is dynamic, so if another manager asks about how furniture is selling in the other retail outlet, you can just open the dropdown selector to quickly select any product line for this same top 5 analysis/report. Context filters open up a powerful new layer of reporting that helps you answer far more specific and granular business questions.

Final Thoughts

This tutorial shows you four essential top filtering and data visualization techniques to have inside your Tableau toolbox - from how to create a basic top filter to leveraging sophisticated and interactive reports. This powerful and deceptively simple concept, Context Filtering in particular, can add real impact to your daily reports, weekly reports, and, of course, the monthly report as well.

As you know from this tutorial, creating these interactive and filtered reports requires understanding the order of operations, parameters, and advanced reporting settings, plus just clicking through many tabs. But it does need a data analytics platform and a way to simplify routine reporting. When building our own AI data analyst, named Graphed, the idea of context-filtering was in all of our conversations as we architected a new AI platform from scratch. Want to simplify complex requests for sales or marketing data? Now you no longer have to create that top report on their behalf. You can make reports in plain language in Graphed from dozens of platforms in minutes - not over a set of few hours/days. Now we just type in one straightforward text description - such as "Show me the top 5 Products by sales in our Furniture Category” - and we instantly generate a dynamic chart or an entire dashboard from our connected data sources. This means that a marketing team, their agency partners, and everyone in between has access to this data insights platform to produce their own report with only plain English prompting!