Site icon DataFlair

Tableau Filters – Get the best out of your data

Tableau filters - types, application and filter pane

FREE Online Courses: Your Passport to Excellence - Start 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

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.

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.

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.

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.

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.

Technology is evolving rapidly!
Stay updated with DataFlair on WhatsApp!!

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.

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.

The field name on the filter pane will turn grey when a context is applied.

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

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.

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.

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

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

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.

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.

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.

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).

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.

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.

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.

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.

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:

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.

The next option here is the Custom value list from where we can type the field name and add it to the filter 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.

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.

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.

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.

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.

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.

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.

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.

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.

Exit mobile version