How to Create a Dynamic Filter in Tableau

Cody Schneider7 min read

Building a Tableau report that just displays data is one thing, crafting an interactive dashboard that users actually enjoy exploring is another. The secret often lies in dynamic filters - smart, responsive controls that update automatically based on user selections, creating a clean and intuitive experience. This guide will walk you through exactly how to set up dynamic filters in Tableau, starting with the simplest method and moving to a more advanced technique.

What Exactly is a Dynamic Filter in Tableau?

A dynamic filter automatically adjusts the options it displays based on selections made in other filters. Think of it as a series of connected choices. Instead of showing you every possible option all the time, it intelligently narrows down the list to only show what's relevant.

For example, imagine you have two filters: State and City. Without a dynamic relationship, your "City" filter would list every single city in your dataset, forcing you to scroll endlessly to find one in the state you've selected. With a dynamic filter, once you select "California" in the State filter, the City filter automatically updates to show only cities within California. This is often called a "cascading" or "hierarchical" filter.

This simple change has several powerful benefits:

  • Sleeker User Experience: It prevents users from being overwhelmed by long, irrelevant lists. Finding the right information becomes faster and more intuitive.
  • Reduces Errors: It makes it impossible for a user to select a combination that yields no data, like choosing the state "Texas" and the city "Los Angeles."
  • Improved Dashboard Speed: By limiting the number of options the view needs to consider, dynamic filters can contribute to slightly faster dashboard performance, especially with large datasets.

Method 1: The 'Only Relevant Values' Trick (The Easy Way)

This is the most common and straightforward way to create a dynamic filter in Tableau. It's perfect for creating dependencies between standard filters, like Country > State > City. Let's build one using the sample "Superstore" dataset that comes with Tableau.

Step 1: Set Up a Basic Worksheet

First, let's create a simple map to visualize our data.

  1. Open Tableau and connect to the Sample - Superstore data source.
  2. In a new worksheet, double-click the State field. Tableau will automatically create a map view.
  3. Drag the Sales field onto the Color tile in the Marks card.
  4. Your worksheet should now show a map of the United States, with states colored by their total sales.

Step 2: Add Your Filters to the View

Now, we'll add the two filters that we want to connect: Region and State. The goal is to make the State filter show only the states within the selected Region.

  1. From the Data pane, drag the Region field to the Filters card. A pop-up will appear. Select all regions for now and click OK.
  2. Drag the State field to the Filters card as well. Select all states and click OK.
  3. Right-click on the Region filter in the Filters card and select Show Filter.
  4. Do the same for the State filter. You should now see both filter control cards on the right side of your worksheet.

At this point, the filters are independent. If you deselect the "Central" region, the states on the map will disappear, but the "State" filter list will remain unchanged, still showing all states from all regions.

Step 3: Activate 'Only Relevant Values'

This is where the magic happens. We need to tell the "secondary" filter (State) to pay attention to the "primary" filter (Region).

  1. Find the State filter card you just created.
  2. Click the small downward arrow (a dropdown menu icon) in the top-right corner of the card.
  3. From the context menu, select Only Relevant Values.

That's it! Now test it out. In your Region filter, deselect a few regions. You'll notice that the State filter's list immediately shortens to show only the states that belong to the region(s) you have selected. You've successfully created a dynamic, cascading filter.

Method 2: Using Parameters for an Advanced 'Top N' Filter

While 'Only Relevant Values' is great for hierarchical dimensions, sometimes you need more flexibility. Parameters are your best friend for this. A parameter is a user-controlled variable that can be used in calculations and can be incorporated into filters, sets, and reference lines. Let's create a dynamic filter that allows the user to see the "Top N" products by sales, where "N" can be 5, 10, or 20.

Step 1: Create Your Parameter

First, we need to let the user choose how many products they want to see.

  1. In the Data pane, click the small dropdown arrow next to the search bar and select Create Parameter.
  2. Name your parameter something clear, like Top N Products.
  3. Set the Data type to Integer.
  4. Under Allowable values, select List.
  5. In the "List of values" table that appears, add the values you want to offer the user. Let's add 5, 10, and 20.
  6. Click OK.

You'll now see your [Top N Products] parameter at the bottom of the Data pane. Right-click it and select Show Parameter to make it visible on your view.

Step 2: Build a Basic View

Let's create a simple bar chart showing sales by product.

  1. Create a new worksheet.
  2. Drag Product Name to the Rows shelf.
  3. Drag Sales to the Columns shelf.
  4. Click the sort icon in the toolbar to sort the products in descending order by sales.

You now have a long list of all products, from best-selling to worst.

Step 3: Create the Filter using a Set

Next, we will create a dynamic set that uses our parameter to determine which products belong in the "Top N."

  1. In the Data pane, find the Product Name dimension. Right-click on it and go to Create > Set…
  2. Name the set something like Top Products by Sales Set.
  3. Go to the Top tab within the "Create Set" dialog box.
  4. Select By field. The default should already be set to Top | 10 | Sales | Sum.
  5. Click on the number '10' and you'll see a dropdown menu. Select the parameter we just created: Top N Products.
  6. Click OK.

Step 4: Apply the Set as a Filter

The last step is to use our newly created dynamic set to filter the view.

  1. Find your set, Top Products by Sales Set, from the Data pane at the bottom section.
  2. Drag <code>Top Products by Sales Set</code> onto the Filters card.
  3. The view will immediately update.

Now, take a look at your visualization. If your Top N Products parameter control (the little dropdown selector in your worksheet view) on the side is set to '5,' your chart will only show the top 5 products sorted by sales. Change the parameter to '10' or '20', and the chart will instantly and dynamically update to show the new 'top N' performers. You've successfully used a parameter to create a powerful, user-driven filter.

Best Practices for Dynamic Filters

As you build more complex dashboards, keep these tips in mind:

  • Give Clear Instructions: While dynamic filters are intuitive, it can be helpful to add a small text object to your dashboard like, "First, select a region to see the available states" to guide your users.
  • Consider Default Selections: When a user first opens your dashboard, what do you want them to see? Set sensible default selections for your filters to present an insightful initial view.
  • Logical Ordering: On a dashboard, physically place your filters in a logical order. The primary filter (e.g., Region) should appear above or to the left of the secondary filter (e.g., State).

Final Thoughts

Mastering dynamic filters is a huge step toward transforming your Tableau dashboards into powerful, interactive analytical tools. Whether you're using the simple 'Only Relevant Values' option or leveraging the flexibility of parameters, these techniques help you guide your users through the data story in a smarter, more efficient way.

Of course, for teams that need to create dashboards without the hefty learning curve of complex tools like Tableau, there's an even faster way. We built Graphed to do all the heavy lifting for you. You can connect all your data sources like Google Analytics, Shopify, and Salesforce in minutes and then simply describe the dashboard you want in plain English. Graphed's AI handles all the visualization and filtering logic for you, delivering a real-time, interactive report in seconds, so you can spend less time building and more time analyzing.

Related Articles

How to Connect Facebook to Google Data Studio: The Complete Guide for 2026

Connecting Facebook Ads to Google Data Studio (now called Looker Studio) has become essential for digital marketers who want to create comprehensive, visually appealing reports that go beyond the basic analytics provided by Facebook's native Ads Manager. If you're struggling with fragmented reporting across multiple platforms or spending too much time manually exporting data, this guide will show you exactly how to streamline your Facebook advertising analytics.

Appsflyer vs Mixpanel​: Complete 2026 Comparison Guide

The difference between AppsFlyer and Mixpanel isn't just about features—it's about understanding two fundamentally different approaches to data that can make or break your growth strategy. One tracks how users find you, the other reveals what they do once they arrive. Most companies need insights from both worlds, but knowing where to start can save you months of implementation headaches and thousands in wasted budget.