KNOWLEDGE BASE

Showing Only Partitions in the View that Contain All Filter Selections from One Filter


Published: 26 Jun 2017
Last Modified Date: 27 Jun 2017

Question

Tableau "Include" filters return any record from the underlying data where any of the selected options are true. Sometimes the goal may be to filter the view to show only partitions where all of the filter selections are true. This article describes how to show only partitions in the view that contain all filter selections from one filter.

For example, in the sample data set Superstore, in a view with [Customer Name] and [Sub-category], the default [Sub-Category] filter will show all records that have any of the selected sub-categories. However, we would like to show only customers that have all of the selected sub-categories.

Environment

Tableau Desktop

Answer

  1. Drag [Customer Name] and [Sub-Category] to the Rows shelf.
  2. Drag [Sub-Category] to the Filters shelf.
  3. In the Filter dialog, choose at least two sub-categories and click OK.
  4. Create a calculated field with a name like "Force AND logic" with a calculation similar to the following:
    SUM( { EXCLUDE [Sub-Category] : COUNTD( [Sub-Category] ) } )
    = 
    SUM( { EXCLUDE [Customer Name], [Sub-Category] : COUNTD( [Sub-Category] ) } )
  5. Drag [Force AND logic] to the Filters shelf.
  6. In the Filter dialog, check True and click OK.
Did this article resolve the issue?