In this article, we will show you, How to create Condition / Conditional filters in Tableau with an example.
Conditional Filters in Tableau
Before getting into this Tableau conditional filters demo, Please refer to Filters to understand the basic filtering techniques. For this Conditional Filters in Tableau demo, we are going to use the data source that we created in our previous article. Please visit Data Labels in Reports article to understand the Tableau Data Source.
First, Drag and Drop the English Product Name from Dimension Region to Rows Shelf, and Sales Amount Measures region to Columns Shelf. By default, it will generate the Bar Chart as shown below.
In this Tableau conditional filters example, we are going to add filter condition on English Product Name. First, Please click on the down arrow beside the Product Name present in the Row Shelf will open the menu as shown below. Here, you have to select the Filter.. option.
Once you select the Filter.. option, a new window is opened to create a filter.
By Field option in Tableau Conditional Filters
Following are the list of options available in this Tableau conditional filters section:
First Dropdown List: By default, this will select the Measure value present in the record. But you can change the filed by clicking the down arrow. When you click that down arrow, it displays all the Measures, and Dimensions present in the data source.
Second Dropdown List: By default, this will select the Aggregate Function that is applied to the Measure value. But you can change the function by clicking the down arrow. When you click that down arrow, it displays the list of functions available for that Measures.
Third Dropdown List: By default, this will select the = operator. But you can change the operator by clicking the down arrow. When you click that down arrow, it displays the list of assignment operators that are available.
Load: When you click on this button, Filter window will load the Minimum and Maximum values into their respective textbox fields. This will help you to understand the data.
From the below screenshot you can observe that we are selecting the By filed section. Next, we selected the Sales Amount as the condition, Sum as the Aggregate function, and used the >= operator. And lastly, we added 1,000,000 value in the text box.
The below Tableau conditional filters report is displaying all the records whose Sum of Sales Amount is greater than or equal to 1,000,000.
Tableau Conditional Filters By formula
Here, you can write your own custom and more complex conditions as the Filter condition in Tableau.
While you type any letter in that Text filed, Tableau intelligence will display the list of available options such as Filed Name and function names.
From the below screenshot you can observe that we are selecting the By formula section. Next, we added SUM([SalesAmount]) >= 1000000 code
The following tableau conditional filters report is displaying all the records whose Sum of Sales Amount is greater than or equal to 1,000,000.