← All postsWhat Does Add to Context Do in Tableau?

What Does Add to Context Do in Tableau?

Carlos GarciaCarlos GarciaPublished

What Does Add to Context Do in Tableau?

You right-click a filter on the Filters shelf in Tableau and there it is, between Edit Filter and Apply to Worksheets: Add to Context. Nothing in the menu explains what it does, and the filter card afterward looks almost the same, just gray instead of blue and pinned to the top of the shelf.

The feature is one of the most useful things in Tableau and one of the least obvious. It exists to solve a problem that only shows up once your view has two filters that are supposed to work together and do not.

This guide covers what Add to Context actually changes, the exact steps to use it, where it sits in Tableau's order of operations, and the performance cost that comes with it. Everything factual here is checked against Tableau's own help documentation rather than against the many secondary explanations floating around, because the two do not always agree.

What Does Add to Context Do in Tableau? The Short Answer

Add to Context promotes an ordinary categorical filter into a context filter, which Tableau computes first. Every other filter you have built in that worksheet then runs against the result of that first filter instead of against the whole data set.

Tableau's documentation puts it plainly. By default, as the help page states, "all filters that you set in Tableau are computed independently" — each one looks at every row in the source without regard to what the other filters are doing.

A context filter breaks that symmetry on purpose. Tableau describes it as "an independent filter," and says the others become "dependent filters because they process only the data that passes through the context filter."

The computation happens once per view. Tableau's wording: "The context is computed once to generate the view. All other filters are then computed relative to the context."

That single sentence is the whole feature. Everything else is a consequence of it.

Not sure whether your analytics setup is giving you the numbers you think it is? Get a free SEO audit from SEO Stuff and see what your reporting is actually measuring.

Free audit

Where do you stand in AI search?

A manual SEO + AI search audit of your site: how ChatGPT, Gemini, Perplexity and Claude read and cite it today, and what to fix first. Report within 48 hours, no credit card.

Get my free audit

Or have it all done: AI SEO services, $999 once

Why Do Tableau Filters Need This At All?

The independence of filters is a sensible default. It makes each filter card predictable in isolation, and for most views it is exactly what you want. Filter to one region, filter to one product category, and the two narrow the view together without any ordering question to answer.

The default breaks down the moment one of your filters is a ranking rather than a selection.

Independent filters versus dependent filters

Think about what "independent" means for a Top N filter. A Top 10 filter asks Tableau to rank something and keep the first ten. If it computes independently, it ranks across the entire data set, and only afterward does your region filter throw rows away.

So you ask for the top ten customers in New York City and you get something stranger: the top ten customers nationally, with the non-New York ones deleted. Sometimes that leaves you three rows. Sometimes it leaves you none.

This is the example Tableau's own order-of-operations page uses, and it is the canonical reason the feature exists. Making the city filter a context filter fixes it: the city is resolved first, the ranking then happens inside that result, and you get the ten biggest customers in New York.

Why the filter card alone cannot tell you this

Nothing on the filter card signals which behavior you are getting. Both filters look correct. Both are doing exactly what they were asked to do. The output is simply the answer to a question nobody meant to ask.

That is what makes this worth learning properly rather than discovering by accident at the end of a build. A view can be wrong in a way that looks finished.

How Do You Add a Filter to Context, Step by Step?

The mechanics are short. Tableau documents it as: "To create a context filter, select Add to Context from the context menu of an existing categorical filter."

  1. Build the filter first. Drag the dimension to the Filters shelf and set it the way you want it. Add to Context is not a filter type you create from scratch — it is a change to a filter that already exists.
  2. Right-click the field on the Filters shelf. On a Mac, Tableau's page specifies Control-click.
  3. Choose Add to Context.
  4. Confirm the visual change on the shelf, described below.
  5. Check your dependent filter. If the problem you were fixing was a Top N result, look at it now rather than at the end.

Tableau's order-of-operations page gives the same steps against a concrete field: "Right-click City on the Filters shelf (Control-click on a Mac) and choose Add to Context."

How a context filter looks on the shelf

Tableau lists three visual and behavioral markers. Context filters "Appear at the top of the Filters shelf," are "identified by a gray color on the Filters shelf," and "Cannot be rearranged on the shelf."

Undoing it

The same context menu carries Remove from Context. Tableau notes that the filter then stays on the shelf as a standard filter — you are not deleting the filter, only demoting it back to independent.

Editing a context filter is not free, though. Tableau states that "A new context is computed each time you edit a context filter." Removing the field from the shelf also triggers a recomputation if other context filters remain.

Reporting that looks right and measures the wrong thing is the most expensive kind of broken. Request a free audit and get a second pair of eyes on yours.

Where Do Context Filters Sit in Tableau's Order of Operations?

Tableau publishes an order of operations — the sequence in which it applies filters, calculations and table calculations when building a view. Add to Context is a way of moving one filter to an earlier stage in that sequence.

Worth being precise here, because this is where secondary explanations drift. Tableau's order-of-operations page presents the complete stage list as a flowchart image, not as text, so the only orderings you can quote from the page itself are the ones it spells out in prose. Those are:

  • Data source filters come before the latest-date filter, which Tableau says is set "after data source filters, but before context filters."
  • The latest-date filter is "global to the workbook, while context filters apply per worksheet."
  • Context filters run "before any other filter that you create in a worksheet."
  • Top filters and general dimension filters are applied at the same time — Tableau says "they appear in the same place in the Tableau order of operations." This is precisely why Top N and dimension filters cannot resolve each other without a context.
  • FIXED level-of-detail expressions are "computed before dimension filters are applied."
  • "a dimension filter is applied before a table calculation."

The practical version

For day-to-day work the useful summary is much shorter. Data source filters narrow what Tableau ever sees. Context filters narrow what the worksheet's own filters see. Everything you build on the Filters shelf after that works inside that boundary.

When Should You Use Add to Context?

The strongest signal is a Top N or ranking filter combined with a dimension filter. If your view ranks anything and also slices by something, you need to decide which happens first, and Add to Context is how you decide.

Tableau documents this directly as a supported pattern — the help page has a section on creating "a dependent numerical or top N filter," with the Top 10 example attached.

A second case is any view where a filter is logically a scope rather than a selection. One region, one fiscal year, one business unit — something that defines which universe the rest of the analysis happens in. Promoting that filter to context says so explicitly instead of leaving it to the default.

When to leave it alone

Most views do not need it. Two or three plain dimension filters narrowing a view together are already doing the right thing, and adding a context only buys you a performance cost.

The honest rule: reach for Add to Context when you can name the dependent filter it is supposed to fix. If you cannot name one, you do not need a context yet.

Getting the order of operations right in a dashboard is the same discipline as getting it right in your analytics. Claim a free SEO audit and see which of your numbers are being computed on the wrong population.

What Are the Limitations and Performance Costs?

The cost is real and Tableau is candid about it. The context has to be computed before anything else can run, so it sits on the critical path of every refresh of that view.

Tableau's own guidance on keeping context filters fast, from its "Speed up Context Filters" section:

  • Prefer one effective context to several. Tableau says using a single context filter that significantly reduces the size of the data set is "much better than applying many context filters."
  • Finish your data modeling first. Tableau says "Complete all of your data modeling before creating a context," and notes that changes such as converting dimensions to measures "require recomputing the context."
  • Set your filters and create the context before adding fields to other shelves, which Tableau says makes the later queries "much faster."
  • On dates, Tableau points out that context filters on discrete dates and date bins such as YEAR(date) are "very effective."

One caveat is easy to miss and worth writing on a sticky note: Tableau states that "Context filters can adversely affect any query performance improvements when you use the Assume Referential Integrity option." If a workbook was tuned with that option on, a new context filter can quietly undo part of the gain.

What Tableau's pages do not say

Two absences are worth reporting rather than filling in.

First, neither page mentions a temporary table. A great deal of community writing explains context filters by saying Tableau materializes a temp table in the database, and some of it goes further and describes which databases behave which way. Tableau's current help pages for context filters and order of operations describe the behavior only as computed once, ahead of the other filters. If the temp-table mechanism matters to your database administrator, confirm it against Tableau's performance documentation or your own query logs rather than against a blog post.

Second, neither page describes how context filters interact with percent-of-total calculations, forecasting, or computed sets. The ordering facts quoted above are what the text supports. Treat anything beyond them as untested until you have tested it in your own workbook.

Neither page carries a deprecation, legacy or removal notice, and the context-filters page states it applies to Tableau Desktop, Tableau Cloud and Tableau Server. This is current, supported behavior, not a holdover.

How Does This Compare to the Alternatives?

Data source filters are the heavier instrument. They apply before anything in the worksheet and across the whole workbook, which makes them right for security and scope decisions and wrong for a question you only need answered on one sheet. Context filters are per worksheet, which Tableau notes explicitly when contrasting them with the workbook-global latest-date filter.

Extract filters go further still, removing rows before they reach the extract. Fastest at query time, least flexible, and a change means a new extract.

Level-of-detail expressions solve a different shape of problem. Where a context filter changes which rows the later filters see, a FIXED expression changes the granularity at which a number is computed. If your trouble is an average of ratios rather than a ratio of totals, a context filter will not help you and an LOD expression will.

Sets and calculated fields can sometimes encode the dependency by hand — a calculated flag that is only true for the rows you want ranked, for instance. That works and it hides the logic inside a calculation where the next person will not look. A gray filter card at the top of the shelf is more honest.

The decision is usually this plain: if one worksheet needs one filter to run first, use Add to Context, and if every sheet needs it, push it down to a data source filter instead.

Dashboards are only as good as the data arriving in them. Get a free SEO audit and find out whether your traffic numbers are telling the truth before you build on top of them.

Final Thoughts

Add to Context does one thing: it makes a filter run first, so the other filters in that worksheet work on what it returns rather than on the whole data set. That is why a Top 10 filter inside a city filter starts behaving like a reasonable person would expect.

It is worth learning because the failure it fixes is silent. Nothing errors. The view just answers a question you did not ask, and the only clue is a number that feels slightly wrong.

Use it when you can name the dependent filter you are fixing, keep it to one effective context rather than several, and finish your modeling before you create it. Those three habits cover nearly every way this feature goes wrong in practice.

If you are building reporting on top of web data, the same principle applies one layer down: the order in which filters, sessions and attribution rules are applied decides what your dashboard says. Our guide to building a fleet management dashboard in Tableau walks through a full build where aggregation order determines whether the headline numbers mean anything, and it pairs well with this one.

Want this done for you?

SEO Stuff gets businesses cited by ChatGPT, Gemini, Perplexity and Claude, and ranking in Google. Start with the free audit, a call, or the package.

See where you stand

A free, manual SEO + AI search audit of your site, with a report within 48 hours. No credit card, no sales call.

Get my free audit

Talk it through

A free 15-minute call with the founder about whether AI search is a meaningful opportunity for your business.

Free strategy call

Have it done

The Done-For-You Package: audit, 10 pages of content, 3 DR50+ placements, dashboard. $999 once, delivered in 21 business days.

See the package