Tableau Filters – Get the best out of your data

FREE Online Courses: Elevate Your Skills, Zero Cost Attached - Enroll Now!

In this Tableau Tutorial, we will learn how to apply filters on data in a Tableau workbook. Here, we will learn about applying simple Tableau filters on data visuals as well as about some advanced types like extract filters, interactive filters, etc. So, open your Tableau Desktop and learn with us!

Types of Filters in Tableau

Now, let us first discuss what are the different types of filters in tableau which it provides to us and which we can use for our dataset. So, here are the 5 types of Tableau Filters:

  • Extract Filters
  • Data Source Filters
  • Context Filters
  • Dimension Filters
  • Measure Filters

Extract Filters

The Extract filters in tableau create an extract of a small subset of data from the original data source. When we establish a connection with a data source in Tableau, it gives us two options; Live or Extract. When we extract data from a data source, Tableau creates a local copy of that subset of data in its repository. Thus, we can apply the value present in the extract as a filter.

Right-click on your data source name and select the Extract data option.extract filters in tableau

Select the field of your choice and choose the field values to apply filter. We made an extract having sales data of only region West and segment Corporate.tableau filters - create an extract of data

As soon as we click on Extract, it will update the graph for the West region and the Corporate segment. In this way, we can create multiple set of extracts and apply them as filters in Tableau sheet.tableau extract filter graph

Learn to do the extraction of your data using tableau data extract.

Data Source Filters

Using the data source filters in tableau, we can directly apply our filter conditions on the data source. It filters the data at the data source and then uploads only the remaining data in the Tableau worksheet. To apply a data source filter, go to the Data Source tab and click on the Add option present on the upper right corner.data source filter in tableau

Again click on Add on the dialog box that opens. Select your field and then tick the values that you want to keep, then click on OK. It will show you a small summary of the selected data source filters. Again click on OK to apply the filter.summary of data source - tableau filters

Now, we have data for sales of only two categories; Mobile phones and Laptops. Everything we will create from here will consist of only the data related to this filter.

We can edit the tableau data source filter from the sheet view.editing of data in tableau filters

Context Filters

By using context filters in tableau, we can apply a general context to our overall analysis of Tableau. For instance, in our sales data of electronic sales, we apply the context of the Corporate segment. This means that all of our analysis after this will be relevant to or in the context of the corporate sector.

To add a filter as a context in your Tableau sheet, right-click on the field value in the filter pane and click on the Add to context option. You can remove the context from the same drop-down box.context filters in tableau

The field name on the filter pane will turn grey when a context is applied.application of context in tableau filters

Look in the image below, Tableau will apply the context on the graph and show sales information of electronic items for only Corporate segment.context graph - tableau filters

Dimension Filters

The dimension filters are the filters that we apply on individual dimensions. Dimensions are not aggregated and so, we can select distinct values from the list of field values. To apply the dimension filter, drag a dimension from the list of dimensions to the filter pane. Complete the filtering steps and apply the filter. The dimension filters are shown in blue in the filter pane.dimension filter in tableau

Measure Filters

The measure filters are the filters that we apply using the measure field values. Measure values are always aggregated like sum, average, median, etc. To apply a measure filter, drag a measure field from the measures list to the filter pane. It will ask you to select an aggregation type on the filter value.measure filter in tableau

Next, it will ask you to select a range for the values of the selected field. Move the slider to set your range.value range in tableau filters

We can see in the screenshot below, the graph of sales only shows the total quantity of the items sold between 50 and 250.application of measure filter in tableau

Now!! As we move further, let us see and learn about how to apply these different types of tableau filters which we can use.

How to Apply Filters in Tableau?

For better understanding, we have a sample data set of an electronic store in USA. We made a connection from Tableau to the data source in our system. Have a look at a horizontal bar graph in tableau which shows category and subcategory wise sales of electronic items like phones, cameras, etc.

The colored segments that you can see in each bar is the region-wise segmenting based on sales. That is, it shows the total sales for individual region of USA like Central, West, South, and East. Also, this graph contains fields “Sales”, “Category”, “Regions” and “ Sub-category” from the data set.data set tableau filters

In this data set, we have sales data for four years, that is, 2016, 2017, 2018 and 2019. What we are going to do now is apply filters on this dataset so that we can see data from only the years 2018 and 2019.

1. For this, we first drag the field or dimension “Order Date” to the Filters pane. As our field is a date field, it will ask us to select in what way do we want the date to appear, that is, year, quarter, month, days, weekdays, etc. We select Years and click Next.drag field in tableau filters

2. Then, it asks us to select the years from the list of years available. We select the years 2018 and 2019. To select your choices, check the square boxes from the list and click OK.select tableau filters

3. As soon as we apply the Tableau filter, it will automatically update the graph and show two separate sections for sales in the year 2018 and 2019. On the left-hand side, in the filter card, the name of the field is showing with the filter we selected, that is,  YEAR(Order Date).application of tableau filter

4. We can explore a lot of filter related options from this filter card. Click on the downward arrow given next to the field name in the filter card to get more options.expand options in tableau filters

From here, we get a list of options like Edit filter, Show filter, Clear filter, etc to manage our filter choices. We can also select values and make quick changes from this drop-down list.filter options in tableau

5. We can also apply filters on individual fields that we select to make graphs. We just need to open the drop-down menu from the small downward arrow present on the right of every field in the Row and Column sections. The drop-down list has a Filter option using which we can apply the filter on specific field values.field filter in tableau

6. Also, the Show Filter option will bring the filter pane on the right-hand side of our sheet. We can easily select and deselect values from here to apply/remove filters.show filters in tableau

Filter Pane

In the previous section, we learned how to apply a filter or in other words how to filter out unwanted data from our dataset in Tableau. Now, let us have a closer look at the filter pane of Tableau. In order to stay efficient, you must know well about all the options and tabs of the filter pane.

The filter pane in Tableau has four tabs:

  • General Tab
  • Wildcard Tab
  • Condition Tab
  • Top Tab

All four of these tabs are loaded with very useful options. Let’s have an insight into these four filter pane tabs.

1. General Tab

In the general tab, we get to select the values from a column that we want to keep or remove for our analysis. In other words, the data that we want to filter. As shown in the image below, we select two regions of our choice from the list. Click OK to apply the filter.general tab in tableau filters

The next option here is the Custom value list from where we can type the field name and add it to the filter list.custom value list

Next to this option is the Use all option, we can use this if our list is very long and we don’t want to select all the values manually.

Also, it has an Exclude option that excludes the fields selected by us and shows the remaining or unselected field data on the sheet.exclude option in tableau filters

For instance, we earlier selected the Central and West regions. When we select the Exclude option, it shows data of South and East regions only.excluded values in tableau filters

2. Wildcard Tab

Using the Wildcard tab, we can specify the string literals based on which we can filter our data. It has options like Contains, Starts with, Ends with and Exactly matches.wildcard tab in tableau

Suppose from the enormous list of cities, we only want to see the sales data of the cities starting with New word like New York, Newark, etc. We can type New in the Wildcard tab and it will give us all the matching results.wildcard graph in tableau

Please note that wildcard filters are case sensitive.

We can also have the wildcard search bar on the right of our sheet. We can enter the value that we want to search for and press enter.wildcard search bar in tableau

3. Condition Tab

The condition tab gives us the option to apply a condition on the filter. For instance, if we have a graph showing region-wise sales of electronic items, then we can apply a condition filter to show us only the sales values greater than 50,000.

As soon as we click on OK, it will show us regions, where total sales made, was greater than 50,000. You can also make a formula with the condition of your own and apply it here.

To do this, select the By formula option and enter a formula that is a filter condition. A filter formula option gives you the freedom to enter a condition as per your requirement and relevance to the data.

For instance, if you wish to show sales value greater than 50,000 then we can apply this condition by entering a formula SUM([Sales])>50,000. In the same way, you can formulate any condition based on your needs in this section and apply it on your data set.
condition tab in tableau filters

4. Top Tab

The top tab is used to see only the top or bottom few values in a visualization. We can set the criterion in the By field option of Top tab.top tab in tableau filters

For instance, we want to see the top 10 entries for the average sales. Upon entering the conditions in the Top tab, we will get the top 10 brands with the maximum average sales.top 10 brands in tableau

Summary

This concludes our tutorial on Tableau filters. Here, we saw different types of filter options available in Tableau. Then we learned how to apply filters in a standard Tableau worksheet. Lastly, we explored the filter pane and its various tabs in detail.

See you in the next tutorial on Tableau Histogram.

We hope that you learned from our Tableau Filters tutorial. In case of any queries regarding this article, leave your comments in the comment section. We will be happy to solve your queries.

Did you like this article? If Yes, please give DataFlair 5 Stars on Google

follow dataflair on YouTube

3 Responses

  1. saba says:

    I am not able to understand what you are trying to convey.
    You should explain in some different way
    Language is not clear

    • DataFlair Team says:

      Hey Saba,
      We have updated our tableau filters article. Now, we hope that there will be no issues in understanding.

  2. Fraj says:

    Could you please showcase a filter on top of another filter. Assume you have parameter on one table that shows top N countries based on some measure, can I have another table that has cities respective to the top 5, 10 or N countries that I select in table 1?
    thank you

Leave a Reply

Your email address will not be published. Required fields are marked *