How to Add a Filter in Tableau: Step-by-Step Guide
In this article
To add a filter in Tableau, drag the field you want to filter on from the Data pane onto the Filters shelf, then choose the values to keep. That is the short answer. The rest of this guide covers the exact steps, the difference between filtering dimensions and measures, common mistakes, and how to fix filters that seem to do nothing.
What You'll Need
- Tableau Desktop, Tableau Public, or Tableau Cloud/Server with permission to edit the workbook.
- A workbook with at least one data source connected and a worksheet open.
- The field you want to filter on must be in the Data pane. If it is not, you may need to add it to the data source or create a calculated field first.
Step-by-Step
- Open the worksheet you want to filter. Make sure the field you plan to use appears in the Data pane on the left.
- Drag the field from the Data pane and drop it onto the Filters shelf, which sits just above the Marks card. If you do not see the Filters shelf, it is usually visible by default; if not, check the worksheet layout settings or simply drag the field onto the canvas and use the filter option that appears.
- In the dialog that opens, select the values you want to keep. For a dimension, you will typically see a list of members with checkboxes. For a measure, you will be asked to choose an aggregation and a range or a special value such as All values or Null values.
- Click OK. The view updates immediately, and the field now appears on the Filters shelf. The filter is applied to the current worksheet only unless you promote it.
- To adjust the filter later, right-click the field on the Filters shelf and choose Edit Filter. You can also click the drop-down arrow on the filter card or pill to show or hide the filter control, which lets viewers change values interactively.
- To apply the same filter to every worksheet that uses the same data source, right-click the field on the Filters shelf and choose Apply to Worksheets, then select All Using This Data Source or the specific sheets you want. This is the quickest way to keep dashboards consistent.
- If you want the filter to appear as a control on a dashboard, right-click the field on the Filters shelf and choose Show Filter. A filter card appears on the right side of the worksheet; you can then place it on a dashboard and choose whether it applies to all worksheets or only selected ones.
- For a quick filter on a single mark or category, you can also right-click a value in the view and choose Filter or Keep Only / Exclude, depending on the version. This creates a filter based on the selected mark without opening the full dialog.
Menu labels and dialog wording can differ slightly between Tableau Desktop versions, Tableau Public, and Tableau Cloud, and between Windows and Mac. The Filters shelf and the right-click options described above are consistent across current versions, but if a label looks different, look for the closest matching option.
Common Mistakes
- Filtering a measure without aggregating it. Measures must be aggregated before they can be filtered. If the field is a measure, choose an aggregation such as SUM or AVG in the filter dialog, or convert it to a dimension first if you really want row-level filtering.
- Assuming the filter applies everywhere. By default, a filter applies only to the worksheet where you added it. Use Apply to Worksheets to extend it to other sheets or the whole data source.
- Confusing filter order with calculation order. Tableau applies filters in a specific order: extract filters, data source filters, context filters, dimension filters, measure filters, and table calculation filters. A table calculation may still show values that seem to ignore your filter because it is computed after filtering. If a filter seems not to affect a table calc, try adding the filter to context by right-clicking it and choosing Add to Context.
- Using a filter when a parameter would be better. Filters remove data; parameters let viewers switch values without removing marks. If you want a user to choose between categories, a parameter with a calculated field may be the right tool.
- Forgetting nulls. Null values are excluded by default in many filter dialogs. If you need to include them, check the option to show or include nulls, or create a calculated field that handles nulls explicitly.
Tips
- Use context filters for large data sources when you need a filter to apply before other filters and top N calculations. Right-click the filter on the Filters shelf and choose Add to Context.
- Name your filters clearly if you show them on a dashboard. The filter card title comes from the field name, so rename the field or edit the filter title for clarity.
- For date filters, choose the right mode: Relative Date for rolling periods, Range of Dates for a start and end, or Discrete dates for individual values. Relative date filters are especially useful for dashboards that should always show the last 30 days.
- Test filters on a copy of the worksheet before applying them to a whole data source, so you do not accidentally hide data on other sheets.
- If a filter card is not showing on a dashboard, check that the filter is set to Apply to Worksheets > All Using This Data Source or that the dashboard is set to use the same filter. Dashboard filter behavior can be controlled per filter card.
Troubleshooting
- The filter does nothing. Check whether the field is already filtered elsewhere, whether the filter is applied to the correct worksheet, and whether a table calculation is ignoring it. Try adding the filter to context.
- The filter dialog is empty or shows no values. This usually means the field has no data in the current extract or the data source is not connected. Refresh the data source and check for nulls.
- Other worksheets lost data. You may have applied the filter to all worksheets using the data source. Right-click the filter and choose Apply to Worksheets > Selected Worksheets to limit it.
- The filter card is missing on a dashboard. Right-click the field on the Filters shelf and choose Show Filter. Then on the dashboard, use the filter card menu to set which sheets it affects.
- Performance is slow after adding a filter. Large dimension filters can be expensive. Consider creating an extract, using a context filter, or filtering earlier in the data source.
Frequently Asked Questions
How do I add a filter to all worksheets at once?
Right-click the field on the Filters shelf and choose Apply to Worksheets > All Using This Data Source. This applies the same filter to every sheet that shares the data source.
Can I filter by a measure value?
Yes. Drag the measure to the Filters shelf, choose an aggregation, and set a range or a special value. Measures must be aggregated before filtering.
What is the difference between a filter and a parameter?
A filter removes data from the view. A parameter is a user-controlled value that can be used in calculations, filters, or reference lines without removing marks by itself.
Why does my table calculation ignore the filter?
Table calculations are computed after filters. If you need the filter to apply before the table calculation, add the filter to context by right-clicking it and choosing Add to Context.
How do I show a filter control on a dashboard?
Right-click the field on the Filters shelf and choose Show Filter. The filter card appears on the worksheet and can be placed on a dashboard. Use the filter card menu to set which worksheets it affects.
Can I filter null values?
Yes. In the filter dialog, look for the option to include or exclude nulls, or create a calculated field that handles nulls explicitly and filter on that field.