Last Modified Date: 13 Aug 2018
AnswerThe attached example workbook uses the sample data set Superstore to demonstrate all three options.
Option 1: Use a Set as a Filter
- Right-click [Product Container] in the data pane, and select Create > Set…
- In the Create Set dialog, do the following and click OK:
- Check all options that should appear in the final filter card
- Name the Set something like Product Container Set
- Remove [Product Container] from the Filters shelf
- Drag [Product Container Set] to the Filter shelf
Option 2: Exclusion Filter Using Only Relevant Values
- Right-click [Product Container] in the data pane, and select Duplicate
- Drag [Product Container (copy)] to the Filters shelf
- In the Filter dialog, check all options that should appear in the final filter card and click OK
- Right-click the Product Container card in the view and select Only Relevant Values
Option 3: Use a Parameter as a Filter (can be used with blended data)
- In the data pane, right-click the [Product Container] field and select Create > Parameter…
- Tableau Desktop will automatically populate the values of [Product Container] in the parameter. In the Create Parameter dialog box, do the following and click OK
- Add "All" to the List of values
- Remove all options that should not appear in the final filter card
- Right-click [Product Container Parameter] in the data pane and select Show Parameter Control
- Select Analysis > Create Calculated Field
- In the Calculated Field dialog box that opens, do the following, and then click OK:
- Name the calculated field. In this example, the calculated field is named "Product Container Filter Calc"
- In the formula field, create a calculation similar to the following:
[Product Container] = [Product Container Parameter] OR [Product Container Parameter] = "All"
- Replace [Product Container] on the Filters shelf with [Product Container Filter Calc]
- In the Filter dialog, check True and click OK
Additional InformationNote: For all three options, any fields excluded from the filter will also be excluded from the view.
The calculation in option 3 can be modified to not filter out values excluded from the parameter control. For example, the following calculation:
[Product Container] = [Product Container Parameter]
OR [Product Container Parameter] = "All"
OR [Product Container] = "Medium Box"
To view options 1 and 2 in action, see the video below:
Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Training and Tutorials