pbPassingBI
/
Connecting & modeling advanced 11 min

Filters and the order of operations

Why your filter did not do what you expected — the pipeline that governs everything.

What you'll be able to do
  • Recite the filter order of operations
  • Explain what a context filter changes
  • Predict how a top N filter interacts with a dimension filter

The pipeline

Tableau applies filters in a fixed order. Knowing it explains most "why is this number wrong" problems:

  1. Extract filters
  2. Data source filters
  3. Context filters
  4. Dimension filters (including top N and conditional)
  5. FIXED level of detail expressions
  6. Measure filters
  7. Table calculation filters

Anything earlier constrains what later steps can see.

Context filters

A context filter is promoted above ordinary dimension filters. Tableau materialises a temporary table containing only the rows that pass it, and every subsequent filter operates on that subset.

The classic use is top N. If you filter to the top 10 products and separately filter to one region, the top 10 is computed across all regions, then intersected with the region — which usually isn't what you meant. Put the region filter in context and the top 10 is computed within that region.

Add one by right-clicking a field on the Filters shelf and choosing Add to Context.

The cost

That temporary table has to be built, and it's rebuilt whenever the context filter changes. On a large source that's expensive. Use context filters when you need the ordering, not as a habit — and avoid putting a fast-changing quick filter in context.

Where FIXED sits

Notice that FIXED LOD expressions are computed after dimension filters but before measure filters. This is why a FIXED calculation ignores your quick filters — a common surprise.

If you need a FIXED expression to respect a filter, promote that filter to context. That moves it above the LOD in the pipeline.

Key points
  • Extract → data source → context → dimension → FIXED → measure → table calc
  • Context filters materialise a temp table and reorder what comes after
  • FIXED ignores dimension filters unless those filters are in context
Check yourself