Context Filters
A context filter is a special type of filter in Tableau that creates a temporary, independent data set as the basis for all other filters applied afterward.
Why Use a Context Filter?
- Performance - Tableau materializes the context filter's result once, so subsequent filters process a smaller dataset instead of the full source.
- Dependency - other filters (like a Top N filter) can be made to operate only within the context filter's result, rather than the entire data source.
Setting a Context Filter
Right-click a field already on the Filters shelf -> Add to Context
The field's pill turns gray, indicating it's now a context filter and is evaluated before any other filters in the view.
Example Use Case
To show the "Top 5 products by sales" only within a specific region, the region filter should be set as a context filter first - otherwise the Top 5 filter would be calculated across all regions before the region filter is applied.
Context filters are powerful but come with a small performance cost each time the view refreshes, since Tableau has to rebuild the temporary dataset - use them when a genuine filter dependency exists, not for every filter by default.