KNOWLEDGE BASE

How To Filter Data In AND Logic When Selecting Multiple Dimension Members


Published: 25 Dec 2020
Last Modified Date: 25 Dec 2020

Question

To filter Product Name by selecting Alabama and Arkansas in the State filter, the products which were bought in Alabama OR Arkansas is displayed. How to filter into products which were bought both in Alabama AND Arkansas?

Environment

  • Tableau Desktop

Answer

The attached workbook created from Sample - Superstore demonstrates the following steps.
  1. Right-click State > Create > Parameter.
  2. In the create parameter window, name the parameter as State 1 and add All to the list of values, then click OK.
  3. Right-click the State 1 parameter > Duplicate and rename the duplicated parameter as State 2.
  4. Click Analysis > Crate Calculated Field to create the AND Logic Filter calculated field with the following formula.
    {FIXED [Product Name]: MAX([State]=[State 1]) OR [State 1]="All"} AND 
    {FIXED [Product Name]: MAX([State]=[State 2]) OR [State 2]="All"}
    
  5. Right-click the State 1 parameter > Show Parameter.
  6. Right-click the State 2 parameter > Show Parameter.
  7. Place Products and State to rows and Sales to text.
  8. Place AND Logic Filter to filters and select True.
Did this article resolve the issue?