01 / 20

Filters &
Filter Order

Master how Tableau filters your data at every stage: from extract to table calc. Understand the critical order of operations that determines what you see.

Tableau

What Is a Filter?

A filter is a rule that removes rows or values from your data before (or after) Tableau builds a visualization. Think of it as a gatekeeper: only data that passes the filter's condition appears in your chart.

Why Filter Order Matters

Tableau applies filters in a strict sequence: not all at once. A filter applied early removes data before later calculations can see it. This means the same filter condition can produce different results depending on where in the pipeline it is placed.

Order changes totals
A dimension filter on "Region" removes rows before Tableau calculates \( \text{SUM(Sales)} \).
Order changes ranks
A table calc filter hides rows after ranks are computed, so Rank 1 might disappear but Rank 2 doesn't become Rank 1.

Dimension vs Measure Filters

Dimension Filter
Filters on categorical fields: Region, Category, Customer Name. You pick which members to include or exclude.
Measure Filter
Filters on quantitative fields: Sales, Profit, Quantity. You set a numeric range or threshold (e.g., \( \text{Sales} > 500 \)).

The Tableau Filter Pipeline

1. Extract Filters 2. Data Source Filters 3. Context Filters 4. Dimension Filters (on the Filters shelf) 5. Measure Filters (aggregated) 6. Table Calc Filters Categorical Quantitative Post-render Earliest Latest

Extract & Data Source Filters

1
Extract Filters run when you create an extract (.hyper file). They permanently remove data: rows excluded here never enter Tableau at all.
2
Data Source Filters apply to the connection itself, before any sheet sees the data. Useful for limiting all worksheets to a specific year or region.

Context Filters

A context filter creates a temporary, smaller dataset that all other filters in the view operate on. It runs at step 3: after data source filters but before dimension and measure filters.

When to use
When you need a "Top N" filter to work within a specific group. E.g., "Top 10 products in the West region."
How to set
Right-click a filter pill on the Filters shelf and choose "Add to Context." It turns grey to signal priority.

Dimension Filters: Include or Exclude

Dimension filters (step 4) let you select specific members of a categorical field. Tableau evaluates these before aggregating measures.

All Regions East $12,400 West $18,200 South $9,800 Central $15,600 Total: $56,000 Filter: Keep West, Central Filtered Result West $18,200 Central $15,600 Total: $33,800

Measure Filters: Numeric Thresholds

Measure filters (step 5) apply after aggregation. Tableau first computes the aggregate (SUM, AVG, etc.), then checks if the result passes the filter condition.

Aggregated Data Chairs $8,200 Tables $22,100 Phones $31,400 Pens $2,900 Paper $6,700 Filter:
\( \text{SUM(Sales)} \)
\( > \$10,000 \)
Filtered Result Tables $22,100 Phones $31,400 Only products > $10K

Table Calculation Filters

Table calc filters (step 6) are the last filters applied. They hide marks from the view after all other calculations (including running totals, ranks, and percent of total) have been computed.

Key Distinction: Dimension vs Measure

Dimension Filter Measure Filter
Acts on Individual category members Aggregated numeric values
Pipeline step Step 4 Step 5
Example Keep only "West" region \( \text{SUM(Sales)} > \$10,000 \)
Runs before aggregation? Yes No (after)
Changes totals? Yes: removes rows Yes: removes marks
UI appearance Checkboxes or list Slider or range input

How to Apply Filters in Tableau

1
Drag a field from the Data pane to the Filters shelf. Tableau detects whether it is a dimension or measure.
2
Choose filter type: for dimensions, pick members from a list. For measures, choose an aggregation (\( \text{SUM} \), \( \text{AVG} \)) and set a range or condition.
3
Promote to context if needed: right-click the pill and select "Add to Context" to move it to step 3 in the pipeline.
4
Show the filter control: right-click the pill and select "Show Filter" to create an interactive widget for dashboard users.
5
Verify results: check totals and marks. If something looks wrong, review the filter order in the pipeline.

Example 1: Dimension Filter

Scenario: You have sales data for 4 regions. You only want to see East and West in your bar chart.

Example 2: Measure Filter

Scenario: You want to show only product sub-categories where \( \text{SUM(Profit)} > \$5,000 \).

Example 3: Context Filter + Top N

Scenario: Show the Top 5 products by Sales in the West region only.

✕ Without Context 1. Top 5 computed from ALL regions
2. Then \( \text{Region} = \text{"West"} \) applied
3. Result: 0-5 products shown (Top 5 overall may not be in West) Wrong result ✓ With Context
1. Context: \( \text{Region} = \text{"West"} \) first
2. Dataset shrinks to West only 3. Top 5 computed within West (Exactly 5 West products shown) Correct result

Common Mistakes

✕ Forgetting Context
Using a Top N filter without adding the grouping dimension to context. The Top N is computed globally, not within your desired group.
✕ Filtering Pre vs Post
Expecting a dimension filter to behave like a table calc filter. A dimension filter changes totals; a table calc filter only hides marks.
✕ Measure on Unfiltered Data
Setting a measure filter threshold without realizing dimension filters have already removed rows, shrinking the aggregated values.

Filter Order Summary

Step Filter Type When It Runs Effect
1 Extract At extract creation Permanently removes rows
2 Data Source On connection Limits all sheets
3 Context Before dimension filters Creates subset for Top N
4 Dimension Before aggregation Removes categorical members
5 Measure After aggregation Removes marks by value
6 Table Calc After all calculations Hides marks, keeps calcs intact

Question 1 of 5

Which filter type is applied earliest in Tableau's order of operations?

Question 2 of 5

A dimension filter on \( \text{Region} = \text{"West"} \) is applied at step 4. What happens to \( \text{SUM(Sales)} \)?

Question 3 of 5

You want to show the Top 5 products by Sales within the West region. You add a Top 5 filter and a Region filter. The result shows fewer than 5 products. What went wrong?

Question 4 of 5

What is the key difference between a measure filter and a table calculation filter?

Question 5 of 5

You filter out the #1 ranked product using a table calculation filter. What happens to the product that was ranked #2?