Tableau Filters are used to restrict the data as per the client’s requirements. For example, we can exclude a region from the display, or we can display the top 10 performing records or low performing records using Tableau Filters.
Before we start our example, It is essential to understand the Order of the Operations in which Tableau will execute the filters in our workbook. And the order would be:
In this article, we will show you how to create basic Tableau filters with example?. For this demo, we created two Hierarchies that represent the Country and Products. The below screenshot will show you the dimensions, and measures preview
Creating Tableau Filters
First, Drag and Drop the City 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. Please remember, We have 269 Rows in our Report. Also visit Hierarchies and Data Labels in Reports article to understand the Tableau Data Source.
Create Filters in Tableau Approach 1
The Desktop allows you to select the individual data points or a group of data points from the report. Once you picked the data points, you will get two options called Keep Only, and Exclude. Selecting either of the two means you are using the Filters indeed.
For example, if you observe the below screenshot, we are selecting some random 16 Cities from the bar chart. Next, we are using Keep only option. It means we are using the Tableau filter stating that Cities with the selected names should be displayed.
As you can see, the report is displaying the records that we selected in the previous step. And most importantly, City dimension appeared at Filters Shelf.
Create Filters Approach 2
In this Tableau Filters example, We will use the Exclude Option. Here, we are selecting the first 96 Cities from the bar chart. Next, we are using the Exclude option. It means we are using the filter stating that Cities with the selected names should restrict from the display.
You can observe that the tableau Filter report is displaying the cities starting with E.
Though the above examples are enough to understand the basic filters in Tableau. I want to provide two more samples using the Tableau Maps. It might be useful for further reference.
Creating Filters in Tableau Maps
Drag and Drop the Sales Amount Measures region to Columns Shelf, and City Name from Dimension Region to Rows Shelf. By default, Tableau will generate the Bar Chart. So, please change it to Map using Show Me Shelf. As you can see, the Tableau Map is stating that there are 128 Unknown regions.
Double click on it, will open the following window with multiple options. It is an entirely different topic, and we will discuss the possibilities in the Maps section. For now, we are choosing the second option. It means, we are applying the filters on the Map, and insisting the Map not to show those 128 regions.
Now you can see the Map that excluded those 128 regions. It also called as filtering map data in Tableau.
Create Filters using Exclude Option
We are selecting the data points from the Europe Region from the Map. Next, we are using the Exclude option to create Tableau filters. It means we are using the condition stating that, Sales Amount with that Region should restrict from the display.
Now you can see the map without the European data.
Create Tableau Filters using Keep Only Option
We are selecting the data points from the United States Region from the Map. Next, we are using Keep Only option. It means we are using the conditional filter stating that, Sales Amount with the United States Region should only display.
The below screenshot will show the Tableau filter Map.