Skip to content
Module 07 of 1245 min readMixed

Filters, context filters, and sets

Filter order of operations, context filters as performance optimisation, sets for cohort analysis. Why the filter you added didn't apply where you expected.

58%

Listen along

Read “Filters, context filters, and sets” aloud

Plays in your browser using on-device text-to-speech — nothing leaves the page.

Learning objectives

By the end of this module, you should be able to:

  • 01Apply filters in the correct order so they behave as expected
  • 02Use context filters as a performance and logic optimisation
  • 03Build sets for cohort analysis and reusable groupings

Tableau has six places where filters can be applied, and the order matters enormously. A junior analyst adds filters where they fit and prays they work; a senior analyst knows the order of operations and uses it deliberately to control performance and logic.

The filter hierarchy (top runs first)

  • Data source filters: applied at the source level, before anything else. Use for security or to prune massive datasets.
  • Context filters: 'Add to Context' — runs before any other filter. Critical for top-N within a filtered slice.
  • FIXED LODs: evaluated at this stage; before dimension filters.
  • Dimension filters: 'Year = 2024'. The default kind.
  • INCLUDE / EXCLUDE LODs: evaluated after dimension filters.
  • Measure filters: filter aggregated values, like 'SUM(Sales) > 10000'.
  • Table calc filters: applied last. Used for 'show me only the top 10 after the table calc ran'.

The classic context-filter trap

You filter to 'Region = East Africa' and you also want 'Top 10 customers'. Without context filters, Tableau computes the top 10 GLOBALLY first, then filters out non-EA — leaving fewer than 10. The fix: right-click Region filter → Add to Context. Now East Africa is established first; top-10 is computed within that context. Most common interview question on filters.

Sets

A set is a saved selection — like a list of customer IDs that meet a condition. Two flavours:

  • Static set: hand-picked. Right-click rows → Create Set. The selection is frozen at creation.
  • Dynamic set: condition-based. 'All customers with lifetime sales > $10k' — updates automatically as data refreshes.

Sets are the right answer for cohort analysis: 'compare buyers who first purchased in 2022 against those who first purchased in 2024'. Build two sets, drop both on Colour, and the chart paints them side-by-side.

Exercise

Build a dashboard with a Region filter and a 'top 5 customers by revenue' table. Without context filters, the table shows the global top 5 — filter Region to East Africa and you might see fewer than 5. Right-click Region filter → Add to Context. What changes? Why?

Key takeaways

  • Filter order of operations is the most-confusing Tableau topic — memorise the chart.
  • Context filters run first and shrink the data for everything downstream.
  • Sets are cohorts: 'top 10 customers', 'customers who bought before 2023'.
Loading progress…
LeadAfrikPublic Economics Hub