Video | Tableau | Data visualisation | Analytics

An Introduction to order of operations in Tableau

In this video, I take on an important but little understood concept in Tableau.

Part of Tableau Key ConceptsTableau Level of detail functions
Watch on YouTube
  • Tableau processes filters and calculations in a fixed sequence: extract filters first, then data source, context, sets, conditional and top N filters, then dimensional filters, LODs and finally trend and reference lines
  • A top N filter sits above dimensional filters in the order, so a state filter applied alongside it won't be respected before the top N is calculated
  • Moving a dimensional filter into a data source filter forces it to apply before the top N, but it removes those values from the entire data source
  • A context filter (shown greyed out) is the more flexible fix, applying before top N but only within the current sheet so other states remain available
  • Understanding the order of operations explains both wrong results and slow performance, since filters higher up the chain are computed earlier

Tableau processes filters and calculations in a fixed order, and not knowing that order can silently give you wrong numbers or slow performance. Understanding where a filter or calculation sits in the sequence lets you fix results that look broken but are actually just being computed in the wrong place.

Using a Superstore-style dataset, Tim builds a view with a top N filter on subcategory alongside a dimensional filter on state, expecting the state filter to narrow results before the top N is calculated.

The Breakdown
  1. What order of operations means 0:41

    Tableau applies filters and calculations in a strict top-to-bottom sequence, much like order of operations in maths dictates the sequence of a calculation. Knowing this sequence exists is the first step to diagnosing odd results.

  2. The operations diagram 1:53

    The documented order runs: extract filters, data source filters, context filters, then sets/conditional/top N/fixed LOD calculations, then dimensional filters, include/exclude LODs, data blending, measure filters, table calcs, and finally trend and reference lines last. Filters and calculations higher up are computed earlier and affect everything computed below them.

  3. Set up a top N filter alongside a dimensional filter 3:56

    Tim builds a top N filter (top three subcategories by sales) and separately adds a dimensional filter for a single state, expecting the state filter to apply first so the top N reflects only that state's data.

  4. Diagnose the wrong result 6:42

    The top three returned don't match a manually validated top three for that state, because a top N filter sits higher in the order of operations than a plain dimensional filter — so the top N is calculated across all states before the state filter is applied. This is the general pattern: if a result looks wrong despite correct-looking filters, check which one is computed first.

  5. Fix it with a data source filter 7:58

    You must move the dimensional filter above the top N in the order for it to be respected first. One way is to add the filter as a data source filter, which sits near the top of the sequence — this works but removes those values from the entire data source, so you lose the ability to look at any other values (e.g. other states) in that source.

  6. Fix it with a context filter instead 9:12

    A more flexible alternative is to add the dimensional filter to context (right-click the filter, add to context — it turns grey). This also applies before the top N calculation, but only within the current sheet, so other values remain available elsewhere in the workbook.

  7. Why this matters generally 11:20

    Beyond fixing wrong numbers, understanding the order explains sluggish performance too — moving filters higher up the chain means less data is processed by everything downstream. Tim doesn't expect full mastery, just enough awareness to recognise when a result or slowdown might be an order-of-operations issue and know where to look.

Worth Knowing
  • A data source filter removes the excluded values from the entire source, so other sheets and other values are no longer available to filter on
  • A context filter is more flexible than a data source filter because it applies before top N but stays scoped to the current sheet
  • Extract filters and context filters both sit above top N, sets, conditional filters and fixed LODs in the sequence, while dimensional filters normally sit below them
  • Trend lines and reference lines are always computed last, and extract filters are always computed first
Use It When

Reach for this whenever a filter combination in Tableau gives a result that looks wrong despite the view seeming correctly set up, or when a workbook is running slower than expected — check whether a filter needs to be moved higher up the order (into data source or context) to take effect before other calculations run.

How this Rollup was made provenance & method

A Rollup is drafted by AI from the video's transcript, then reviewed and edited by Tim. Everything used to produce this one is listed below — the model, the exact prompt, and the source video — so the process is transparent and reproducible.

Transcription
On-device — NVIDIA Parakeet v3 for recent videos, OpenAI Whisper large-v3 for earlier ones. The transcript never leaves the machine or gets published.
Drafting
Claude Sonnet 5 in the cloud, from that transcript.
Prompt
The exact Rollup prompt (v2) — the full system prompt, unedited.
Source video
Watch on YouTube
Drafted
5 July 2026 at 09:38
Reviewed & edited
11 July 2026 at 13:47 · by Tim Ngwena

Model + prompt + video is everything you'd need to recreate a Rollup like this yourself. The one thing we don't share is the transcript.

Rights. The video and its transcript are the property of TN Media Ltd. Unauthorised use or download is prohibited. © TN Media Ltd.