Filters in Tableau
Filtering is one of the most fundamental operations in any analytics tool. In Tableau, filters are not just a mechanism for hiding rows — they are a layered system that executes in a precise sequence, each layer building on the last. Understanding how Tableau processes filters is the single most important concept for building accurate, performant dashboards.
This chapter walks you through every filter type available in Tableau, explains the order of operations that governs them, and shows you how to use them effectively in both worksheets and dashboards.
The Filter Order of Operations
Tableau applies filters in a fixed sequence. This sequence determines what data is visible at each stage and, critically, which filters can see results from other filters. When you add multiple filters to a view, they are not applied simultaneously — each one reduces the dataset before the next filter runs.
Here is the complete order:
| Step | Filter Type | Where It Runs | Notes |
|---|---|---|---|
| 1 | Extract Filters | On extract creation | Permanently limits rows in the extract |
| 2 | Data Source Filters | Before any worksheet | Applies to all sheets using that connection |
| 3 | Context Filters | Per worksheet | Creates a temporary table; other filters run against it |
| 4 | Top N / Condition Filters | Per worksheet | Runs against the context, if one exists |
| 5 | Dimension Filters | Per worksheet | Filters categorical fields |
| 6 | Measure Filters | Per worksheet | Filters aggregated values |
| 7 | Table Calculation Filters | Per worksheet | Filters results after aggregation |
Why Order Matters: A Concrete Example
Imagine you have a dataset of global sales. You want to see the Top 10 products by revenue, but only within the United States.
Scenario A — No Context Filter: You add a Region dimension filter for "United States" and a Top 10 filter by Sales. Because Top N filters (Step 4) run before Dimension filters (Step 5) in certain configurations, Tableau may compute the Top 10 globally first, and then filter to the United States — giving you whichever of those 10 global leaders happened to have US sales, not the actual Top 10 within the US.
Scenario B — With a Context Filter: You promote the Region = "United States" filter to a Context Filter (Step 3). Now Tableau first restricts the dataset to US rows only, creates a temporary result set, and then calculates the Top 10 from that restricted set. You now see the correct Top 10 products within the United States.
This distinction is critical whenever you combine Top N or Condition filters with dimension restrictions.
Practical Implications of Each Stage
Extract Filters are set once when you create or refresh a Tableau extract. They reduce the rows stored in the .hyper file permanently. Use them to exclude historical data you never need (e.g., orders before 2018) or to remove confidential fields. They cannot be changed at view time without re-extracting.
Data Source Filters apply to every single worksheet connected to that data source within the workbook. They are ideal for role-based data restrictions (e.g., a regional manager should only see their region's data across all tabs). They add a small query overhead because they wrap every query sent to the database.
Context Filters create a temporary table or subquery that subsequent filters operate against. Their primary value is making Top N and Condition filters accurate within a filtered subset.
Dimension Filters are the most commonly used filters. They appear as interactive filter cards on worksheets and dashboards.
Measure Filters operate on aggregated values (e.g., SUM(Sales) > 10000) and run after the aggregation step.
Table Calculation Filters use the results of table calculations. Because table calculations run entirely in Tableau's engine (not the database), these filters can drastically reduce performance on large datasets.
Dimension Filters
A dimension filter restricts which members of a categorical field are included in the view. To add one, drag a dimension to the Filters shelf, or right-click a field in the view and choose Filter.
Filter Dialog Tabs
When you open the filter dialog for a dimension, you see four tabs:
General Tab This is the most common way to filter. You can:
- Select from list — check or uncheck specific members. Tableau shows you all distinct values and their counts.
- Use All / None / Exclude — include everything, nothing, or invert your selection.
- Search — useful when a dimension has hundreds of members.
Wildcard Tab Lets you match members using pattern rules:
- Contains — member includes the string
- Starts with — member begins with the string
- Ends with — member ends with the string
- Exactly matches — exact string equality
Example: Filter [Product Name] where it contains "Pro" to show only products with "Pro" in their name.
Condition Tab Lets you filter based on a formula or a summary function:
- By field — e.g., only show [Customer Name] where SUM([Sales]) > 5000
- By formula — write a custom boolean expression, e.g.,
CONTAINS([Product Name], "Chair") AND SUM([Profit]) > 0
Top Tab Lets you show only the top or bottom N members based on a measure. This is covered in detail in the Top N Filters section below.
Keeping vs. Excluding Members
After you create a dimension filter, right-click the field on the Filters shelf:
- Edit Filter — reopen the dialog
- Show Filter — display an interactive filter card on the view
- Remove — delete the filter
In the General tab, note the "Exclude" checkbox at the bottom. When checked, your selected members are excluded instead of included. This is useful when you want "everything except returns" or "all regions except Returns & Cancellations."
Measure Filters
Measure filters operate on aggregated numeric values. To add one, drag a measure to the Filters shelf. Tableau immediately asks you to choose an aggregation (Sum, Average, Minimum, etc.) because you are filtering on a computed value, not a raw row value.
Measure Filter Modes
| Mode | Use Case |
|---|---|
| Range of Values | Filter between a minimum and maximum (e.g., Sales between 1000 and 50000) |
| At Least | Only include values above a threshold (e.g., Profit >= 0) |
| At Most | Only include values below a threshold (e.g., Discount <= 0.3) |
| Special | Handle null values: show only nulls, only non-nulls, or all values |
Null Handling with the Special Tab
The Special tab is often overlooked. When a measure contains null values, those rows are included or excluded based on this setting:
- All values — nulls are included (default)
- Non-null values — nulls are excluded from the view
- Null values — only null rows are shown (great for data quality audits)
Date Filters
Dates in Tableau have their own dedicated filter dialog with multiple modes:
Relative Dates
Show data for a rolling time window relative to today:
- Last N days, weeks, months, quarters, years
- This week, this month, this quarter, this year
- Today, yesterday
Use relative date filters on live connections to dashboards that always need to show "last 30 days" without manual updating.
Range of Dates
Specify a fixed start date and end date. Ideal for static reports covering a known fiscal period.
Starting Date / Ending Date
Open-ended ranges:
- Starting date — all dates on or after a specified date
- Ending date — all dates on or before a specified date
Special (Null Handling)
Same as measure filters — include all, only non-null, or only null date values.
Date Part vs. Date Value
When you drop a date on the Filters shelf, Tableau asks whether you want to filter by:
- Date Part — filter on a recurring component like Month (January, February...) or Year (2022, 2023...)
- Date Value — filter on specific calendar dates (continuous)
- Date & Time — includes the time component for datetime fields
Filter Cards (Quick Filters)
When you right-click a filter on the Filters shelf and choose "Show Filter," a filter card appears on the right side of the worksheet (or on the dashboard). End users can interact with this card to change what they see without editing the workbook.
Filter Card Display Types
| Card Type | Best For |
|---|---|
| Single Value (List) | Small number of mutually exclusive options |
| Single Value (Dropdown) | Small number of options, saves space |
| Single Value (Slider) | Ranges or ordered sequences |
| Multiple Values (List) | Allowing users to select several members |
| Multiple Values (Dropdown) | Many members, compact space |
| Multiple Values (Custom List) | Users type or paste values |
| Wildcard Match | Text search filtering |
| Relative Date | Rolling time windows |
To change the card type, click the small dropdown arrow at the top-right of any filter card and choose a display type.
Relevance Options
Also in that dropdown:
- Only Relevant Values — each filter card updates based on the current selections in other filter cards. If the user picks "West" for Region, only West's product categories appear in the Category filter. This is helpful for guided exploration but can slow performance.
- All Values in Database — always shows the full list regardless of other filters. This is the most performant option.
- All Values in Context — shows only values that exist after Context Filters are applied.
Hiding the "All" Option
By default, filter cards include an "All" option that removes the filter entirely. To disable this:
- Click the filter card dropdown arrow
- Uncheck "Include All Value" (for single-select cards) or uncheck "Show All" (for list cards)
This is important on dashboards where you always want at least one value selected, preventing accidental display of the entire unfiltered dataset.
Context Filters
A Context Filter is a special designation applied to an existing dimension filter. When you mark a filter as a context filter, Tableau:
- Evaluates that filter first
- Physically creates a temporary table (or subquery, for live connections) containing only the rows that pass the filter
- Runs all other filters, Top N, Condition filters, and aggregations against that temporary subset
When to Use Context Filters
You need a context filter whenever:
- You have a Top N filter that should operate within a specific segment
- You have a Condition filter that should only consider data from a specific subset
- Performance is suffering because a complex filter is not being pushed down to the database efficiently
How to Create a Context Filter
- Add the dimension filter you want to use as the context (e.g., drag [Region] to the Filters shelf and select "West")
- Right-click that filter on the Filters shelf
- Choose Add to Context
The filter pill turns gray to indicate it is now a context filter.
To remove context status, right-click and choose Remove from Context.
Context Filter Example: Top 10 Products in the West Region
Step 1: Drag [Region] to Filters, select "West," click OK.
Step 2: Right-click [Region] on the Filters shelf → Add to Context. The pill turns gray.
Step 3: Drag [Product Name] to Filters → Top tab → Top 10 by SUM([Sales]).
Step 4: The view now shows exactly the 10 products with the highest sales within the West region, not the top 10 globally filtered to West.
Condition Filters
Condition filters are found on the Condition tab of the dimension filter dialog. They let you include or exclude dimension members based on:
By Field
Choose a measure and an aggregation, then set a comparison:
- Include [Sub-Category] where SUM([Profit]) is greater than 0
- Include [Customer Name] where COUNT([Order ID]) is at least 5
By Formula
Write a boolean calculation that references aggregates:
SUM([Sales]) / SUM([Profit]) > 3
Include only those dimension members where the sales-to-profit ratio exceeds 3.
Formula-based conditions give you the full power of Tableau's calculation language for filtering.
Top N Filters
The Top tab in the dimension filter dialog lets you limit results to the highest or lowest N members by a measure.
Configuration Options
| Setting | Options |
|---|---|
| Show | Top or Bottom |
| N | A fixed number or a field/parameter |
| By | Any measure with any aggregation |
Dynamic Top N with Parameters
Instead of a fixed number, you can set N to a Tableau Parameter. This lets end users choose how many items they want to see:
- Create a parameter: Data menu → Create Parameter → Integer type → range 1 to 50
- Open the dimension filter dialog → Top tab
- In the N field, click the dropdown and choose your parameter
- Right-click the parameter → Show Parameter Control
Now users can drag a slider to see Top 5, Top 10, Top 20, etc. dynamically.
Applying Filters to Multiple Worksheets
By default, a filter you create on a worksheet applies only to that worksheet. To apply it more broadly:
Apply to Worksheets Options
Right-click any filter on the Filters shelf:
- Only This Worksheet — default behavior
- All Using This Data Source — applies the filter to every sheet in the workbook connected to the same data source
- All Using Related Data Sources — applies across related data sources (using data blending relationships)
- Selected Worksheets — lets you pick specific sheets from a list
This is extremely useful for dashboards. For example, you might have a date filter on Sheet 1 that you want to apply to Sheet 2, Sheet 3, and Sheet 4 simultaneously.
Dashboard Filter Actions
Filter Actions are the primary mechanism for creating interactivity between views on a dashboard. When a user clicks (or hovers over) a mark in one sheet, it filters another sheet.
How to Create a Filter Action
- On a dashboard, go to Dashboard menu → Actions
- Click Add Action → Filter
- Configure:
- Source Sheets — which sheet triggers the action
- Run action on — Hover, Select, or Menu (right-click)
- Target Sheets — which sheet(s) get filtered
- Clearing the Selection — Show all values / Leave the filter / Exclude all values
Clearing Behavior Explained
| Clearing Option | Behavior When User Deselects |
|---|---|
| Show all values | The target sheet shows all data again |
| Leave the filter | Target stays filtered on the last selection |
| Exclude all values | Target shows nothing when nothing is selected |
"Show all values" is the most common and intuitive choice for exploratory dashboards.
Multiple Target Sheets
A single filter action can target multiple sheets simultaneously. This lets a single click on a map update a bar chart, a line chart, and a KPI card all at once.
Data Source Filters vs. Worksheet Filters
Both accomplish filtering, but they serve different purposes:
| Aspect | Data Source Filter | Worksheet Filter |
|---|---|---|
| Scope | All worksheets using that connection | Only the current worksheet (by default) |
| Timing | Applied before any worksheet query | Applied per-worksheet query |
| Visibility | Not shown as an interactive card | Can be shown as an interactive filter card |
| Security | Suitable for restricting sensitive data across the whole workbook | Not suitable for security — users can edit worksheet filters |
| Performance | Can improve performance by reducing data early | Can hurt performance if not index-friendly |
Use Data Source Filters when:
- You need a consistent data restriction across all views (e.g., exclude test orders)
- You are distributing a workbook to users who should never see certain rows
- You want to improve performance by reducing data volume before any queries run
Use Worksheet Filters when:
- The filter is specific to one view's analysis
- You want users to be able to interact with the filter
Parameter-Driven Filters (Introduction to Parameters)
Parameters are dynamic values in Tableau that users can change at runtime. When combined with filters, they make your dashboards highly interactive without requiring separate filter cards for every option.
Common Parameter + Filter Patterns
Dynamic Date Range: Create two parameters (Start Date, End Date) and use a calculated field:
[Order Date] >= [Start Date Parameter] AND [Order Date] <= [End Date Parameter]
Drag that calculated field to the Filters shelf and set it to True.
Dynamic Measure Selection: Create a string parameter with values like "Sales," "Profit," "Quantity" and use it to drive which measure is displayed via a CASE statement in a calculated field.
Top N Control: As described in the Top N section, connect a parameter to the Top filter dialog.
Parameters are covered in depth in a later chapter, but understanding their interaction with filters is essential for building truly dynamic dashboards.
Performance Implications of Different Filter Types
Not all filters are equal in terms of query performance:
| Filter Type | Performance Impact | Reason |
|---|---|---|
| Extract Filter | Best (zero runtime cost) | Applied once at extract time |
| Data Source Filter | Very good | Filters data before worksheet queries |
| Context Filter | Moderate | Creates a temp table; other filters benefit |
| Dimension Filter on indexed column | Good | Database index can accelerate it |
| Dimension Filter on non-indexed column | Poor | Full table scan required |
| Measure Filter | Poor | Requires aggregation before filtering |
| Table Calculation Filter | Worst | Runs in Tableau engine, all data must transfer |
Optimization Tips
- Push filters to the database — use Data Source Filters or Extract Filters whenever the restriction is global.
- Avoid Table Calculation Filters — instead, use a calculated field at the row level and put that on the Filters shelf as a dimension filter.
- Index filter columns — work with your database administrator to ensure columns used in frequently-applied filters have database indexes.
- Use Context Filters sparingly — they create temporary tables; too many can slow down initial load time.
- Only Relevant Values adds overhead — use "All Values in Database" for filter cards when possible.
Practice Exercises
Exercise 1: Multi-Level Filtering
Dataset: Sample - Superstore
Task:
- Build a view showing Sales by Sub-Category.
- Add a Category dimension filter and show it as a Multiple Values (List) filter card.
- Add a Profit measure filter to show only Sub-Categories with SUM(Profit) > $0.
- Observe: does changing the Category filter change which sub-categories pass the Profit filter?
- Now promote the Category filter to a Context Filter. Re-check the behavior.
Goal: Understand how Context Filters affect Measure Filter results.
Expected Outcome: With the context filter in place, the Profit filter evaluates only within the selected categories, potentially showing different sub-categories than without it.
Exercise 2: Top N with Dynamic Parameter
Dataset: Sample - Superstore
Task:
- Create an Integer parameter called "Top N Products" with a range from 1 to 20, step 1, default 10.
- Build a horizontal bar chart of Sales by Product Name, sorted descending.
- Add a Top N filter on Product Name: Top [Top N Products] by SUM(Sales).
- Show the parameter control.
- Add a Region filter as a Context Filter.
- Verify that changing Region changes which products appear in the top N.
Goal: Build a dynamic, context-aware Top N view.
Exercise 3: Dashboard Filter Action
Dataset: Sample - Superstore
Task:
- Create Sheet 1: a map of Sales by State (filled map).
- Create Sheet 2: a bar chart of Sales by Category.
- Create Sheet 3: a line chart of Sales by Order Date (Month).
- Place all three sheets on a single dashboard.
- Create a Filter Action: clicking a state on the map filters both the bar chart and the line chart.
- Set Clearing the Selection to "Show all values."
- Test: click California, verify the other two sheets update. Click away to deselect, verify everything resets.
Goal: Build an interactive geographic drill-down dashboard.
Summary
In this chapter you learned:
-
Filter Order of Operations — Tableau applies 7 filter types in a fixed sequence: Extract → Data Source → Context → Top N/Condition → Dimension → Measure → Table Calculation. This sequence determines which data each filter sees.
-
Dimension Filters — restrict categorical members via list selection, wildcard matching, formula-based conditions, or Top N rules.
-
Measure Filters — restrict aggregated numeric values using range, threshold, or null-handling modes.
-
Date Filters — offer relative, range, starting, and ending modes to control time-based analysis.
-
Filter Cards — display interactive controls to end users; configured with display type (list, slider, dropdown, wildcard) and relevance options.
-
Context Filters — create a temporary data subset that downstream Top N and Condition filters operate against, solving the classic "Top N within a group" problem.
-
Condition & Top N Filters — enable formula-based inclusion/exclusion and rank-based truncation of dimension members.
-
Dashboard Filter Actions — connect views so that user interactions in one sheet filter other sheets, enabling guided analytical exploration.
-
Data Source Filters vs. Worksheet Filters — choose based on scope (workbook-wide vs. sheet-specific), security needs, and performance goals.
-
Parameter-Driven Filters — use parameters to let users dynamically control filter values at runtime.
-
Performance — order filters wisely, push restrictions to the database early, avoid Table Calculation Filters when possible, and use context filters judiciously.
Mastering Tableau's filter system gives you precise control over what data your audience sees, how calculations are scoped, and how different parts of a dashboard interact with each other.