KNOWLEDGE BASE

How to Display Data Only When Two or More Filter Values Are Selected


Published: 09 Jan 2024
Last Modified Date: 09 Jan 2024

Question

Is there a way to show data only if two or more filter values are selected, while showing no data when only one filter value is selected?

Environment

  • Tableau Desktop

Answer

Follow along in the sample packaged workbook found in the Attachments section to review the steps below.

In our example, data is displayed only when two or more values are selected in the Category filter control.

User-added image User-added image

1. Add YEAR(Order Date) and Category to Columns.
2. Add SUM(Sales) to Rows.
3. Add Category to Color.
4. Add Category to Filters shelf. Right-click it and select Add to Context.
5. Create a calculated field and name it Filter condition with the following formula:
{ FIXED : COUNTD([Category]) } > 1
6. Add Filter condition to Filters shelf and select TRUE only.
Did this article resolve the issue?