In Tableau, in what order are extract, data source, context, dimension and measure filters applied?
answer
- filters are a ladder, not a set
- each stage only sees what survived above
- extract and data source come first
- context sits above dimension filters
- aggregate filters run after the GROUP BY
basics
~20 sExtract filters run first, then data source filters, then context filters, then FIXED level-of-detail expressions, then dimension filters, then INCLUDE and EXCLUDE expressions, then aggregate measure filters, then table calculations and any filter on a table calculation.
solid answer
~50 sTableau applies filters in a fixed published order, and every surprising number in a view traces back to it. **Extract filters** run first, when the extract is built, so anything they drop is simply not in the file. **Data source filters** apply to every worksheet on that source. **Context filters** run next and produce the subset everything downstream sees. **FIXED** level-of-detail expressions compute after context but *before* dimension filters. Then **dimension filters** — which includes Top N, conditional filters and computed sets — followed by **INCLUDE/EXCLUDE** expressions, then **measure (aggregate) filters**, which behave like SQL `HAVING` because they run after aggregation. Table calculations come after that, and a filter on a table calculation is a late filter: it hides marks without changing what the calculation already computed. Reference and trend lines are drawn from whatever survives.
code
text · 10 linesExtract filters
-> Data source filters
-> Context filters
-> FIXED LOD expressions
-> Dimension filters (incl. Top N, sets, conditional)
-> INCLUDE / EXCLUDE LOD expressions
-> Measure (aggregate) filters
-> Table calculations
-> Filters on table calculations
-> Trend lines, reference lines, forecastsgo deeper
Recall that Tableau filters are not all equal: extract and data source filters happen before anything a worksheet does, and a filter on an aggregate happens after the numbers are summed.
Be able to recite the ladder and place a symptom on it. Explain that dimension filters become WHERE and measure filters become HAVING, and that context sits between them and Top N.
Demonstrate diagnosis: given a wrong total, name the two stages in conflict and the cheapest fix. Know that context materialises a subset and that rebuilding it on every interaction is a real cost.
Own the convention across a portfolio: which exclusions belong in the extract or data source (never negotiable, never visible), which belong in context, and which are viewer-facing — so that dashboards from different authors do not disagree about the same number.
## The ladder Tableau publishes an order of operations, and it is the single most useful thing to memorise about the tool. The filter-relevant stages, top to bottom: 1. **Extract filters** — evaluated when the `.hyper` extract is created or refreshed. 2. **Data source filters** — attached to the connection, applied to every worksheet that uses it. 3. **Context filters** — the ones you right-click and *Add to Context*. 4. **FIXED level-of-detail expressions**. 5. **Dimension filters** — including Top N, conditional filters and computed sets. 6. **INCLUDE / EXCLUDE level-of-detail expressions**. 7. **Measure (aggregate) filters**. 8. **Table calculations**, then **filters on table calculations**. 9. **Forecasts, trend lines and reference lines**, drawn from what is left. Each stage sees only what the stage above it passed down. That is the whole model, and nearly every "why is this number wrong" question in Tableau is answered by locating two things on this ladder and noticing which one runs first. ## Where the stages land in the query For a live connection, the top stages become SQL. Data source, context and dimension filters become `WHERE` predicates; measure filters become `HAVING`, because they can only be evaluated once the `GROUP BY` has run: ```sql SELECT region, SUM(sales) FROM orders WHERE order_date >= DATE '2024-01-01' -- dimension filter GROUP BY region HAVING SUM(sales) > 100000 -- measure (aggregate) filter ``` Table calculations are different in kind: they are computed by Tableau on the aggregated result set that comes back, not by the database. That is why they sit below everything the database did. ## Consequences you should be able to name **Extract filters are destructive.** Rows they exclude are not in the extract, so no worksheet can ever recover them, and a viewer with permission to see them still cannot. That is a feature when you are trimming an extract for size, and a trap when someone later needs last year's data. **Context changes what Top N sees.** A Top 10 filter and a `Region` filter are both dimension filters, so they run at the same stage and neither can see the other's result. Adding `Region` to context moves it above the Top N, so the top ten are computed within the region. **A FIXED expression ignores dimension filters.** It computes at stage 4, before dimension filters exist. If you need it to respect a filter, that filter has to be in context — or be a data source or extract filter. **A measure filter removes marks, not rows.** Filtering to `SUM(Sales) > 100000` at region grain removes regions. Change the view to city grain and the same filter now removes cities, and the totals move, because the aggregation the filter tests is computed at the view's level of detail. **A table-calc filter is a late filter.** If you filter on a running total or an `INDEX()` calculation, the calculation was already computed over the full set; the filter only hides marks afterwards. That is exactly how you build "rank within the filtered view" behaviour, and exactly why a percent-of-total does not re-scale when you filter that way. ## Context filters have a cost A context filter is not free. Tableau materialises the contexted subset, and whenever the context filter's value changes, that subset is rebuilt and everything downstream is recomputed. Putting a frequently-changed filter card into context — a date range a viewer drags constantly — makes every interaction pay for a rebuild. Context is for filters that are stable within a session and that something downstream genuinely needs to run *after*: Top N, computed sets, FIXED expressions. ## Choosing a stage on purpose Think of the ladder as a set of scopes. Something that must never be visible to anyone belongs in an extract or data source filter. Something that establishes the population a calculation reasons about belongs in context. Something the viewer changes belongs in an ordinary dimension filter card. Something that tests an aggregate is a measure filter by definition. And something that must not disturb an already-computed calculation belongs on a table calculation. ## What interviewers listen for They are not usually testing rote recall of all nine stages. They want you to say the order at least roughly, then apply it to a symptom: given "my top ten shows six rows" or "my FIXED calculation ignores my filter", the answer is the same sentence — those two things are on different rungs, and here is which one runs first.
- Where do table calculations sit, and why does that make them useful as filters?Table calculations run after every database-side filter, on the aggregated result Tableau received. A filter on one is therefore a late filter: it hides marks without changing what the calculation already computed. That is how you rank inside an already-filtered view, and why a percent-of-total will not re-scale when you filter that way.
- What is the cost of putting a filter into context?Tableau materialises the contexted subset, and it is rebuilt whenever the context filter's value changes, recomputing everything downstream. Use context for filters that are stable within a session and that something below genuinely needs to run after — Top N, computed sets, FIXED expressions — not for a date slider a viewer drags all day.
- Why can a data source filter not be overridden by a viewer, while a filter card can?A data source filter is attached to the connection and applied before any worksheet-level filtering, so it is above everything a viewer touches. A filter card is a dimension filter far lower on the ladder, exposed as a control. That difference is why data source and extract filters are used for exclusions that must always hold.
saying these in an interview costs you the question
- Thinks all filters are applied simultaneously as one AND
- Believes a context filter is only a performance optimisation
- Puts a measure filter on the shelf expecting it to remove rows
- Cannot say whether FIXED runs before or after dimension filters
- Adds every filter card to context and calls it tuning