Tutorial Gateway

  • C
  • C#
  • Java
  • Python
  • SQL
  • MySQL
  • Js
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • Alteryx
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Go Programs
    • Python Programs
    • Java Programs

Context Filters in Tableau

by suresh

By default, Filters in Tableau calculate independently. It means each filter will access all the records present in your data source individually. It might be OK if your data source is small, but it will be a bad practice for a large data source.

For example, we want to analyze the Top 10 products in each city present in the United States.

  • The first filter will find the highest performing products within the world.
  • The second filter to display the cities within the United States.

Here, both will access the data source independently, and I must say it’s repeated work. In such a case, we can use the Context Filters in Tableau.

From the above example, if we make the second filter as the Tableau Context filter, then the first filter will search for the data based on the second filter. It means, within the United States, and no need to search for the whole world. Let me show you one example so that you can understand the concept of context filters in Tableau.

Before getting into this Tableau context filter example, Please refer Filters to understand the basic filtering techniques. For this Tableau Context filters demo, we are going to use the data source that we created in our previous article. Please visit Data Labels in Tableau Reports article to understand the Tableau Data Source.

I suggest you remember this report. It can help you to understand the list of categories, subcategories, and its respective Sales Amount we had in our data source

Context Filters in Tableau 1

Create Context Filters in Tableau

In this example, we will show you how to create Context Filters in Tableau. Our scenario is to find the Top 10 product Subcategories present in the Accessories, and Clothing (Product Category).

First, Drag and Drop the English Product Subcategory from Product Hierarchy present in the Dimension Region to Rows Shelf, and Sales Amount Measures region to Columns Shelf. By default, tableau will generate the Bar Chart.

Context Filters in Tableau 2

Here, we are going to add a filter condition on the English Product Name. First, Please click on the down arrow beside the Product Subcategory Name present in the Row Shelf will open the menu. Here, you have to select the Filter.. option.

Context Filters in Tableau 3

Once you select the Filter.. option, a new window is opened to create a filter. Please navigate yourself to the Top tab. From the below screenshot, you can observe that we are selecting the By filed section.

Next, we selected the Top 10 records, Sales Amount as the Measure, and Sum as the Aggregate function. I suggest you refer, Top Filters in Tableau article to understand the properties.

Context Filters in Tableau 4

By clicking the OK button, we created our first filter that will find the top 10 subcategories based on the Sum of Sales Amount.

Next, we are going to add filter condition on Product Categories. To do so, please drag and drop the Product Category from Dimension Region to Filters Shelf.

Context Filters in Tableau 5

Once you drop the Product Name to Filters Shelf, a new window called Filter will open. For the demonstration purpose, Within the General, please check the Accessories and Clothing. I suggest you to refer Tableau Filters on Dimensions article to understand the properties.

Context Filters in Tableau 6

From the below screenshot, you can see that the report is displaying seven subcategories from the Accessories and Clothing category. It means the first Tableau applied the First filter and extracted the top 10 subcategories.

Next, it applied the second filter and displaying the subcategories from in the Accessories and Clothing. We all know that it has three records that represent the Bikes Category.

Context Filters in Tableau 7

Now let us change the English Product category name filter as the Tableau Context Filter. To do so, go to the Filter Shelf and Click on the down arrow beside the category. It will open the menu, and from that menu, please select the Add to Context option.

Context Filters in Tableau 8

Once you select the Add to Context option, the English Product category name filter will convert to the Tableau context filter. As per the Tableau order of execution, the Context filter will be executed first, followed by Filters on Dimension, and then Filters on Measures.

From the below screenshot you can see that it is displaying the top 10 subcategories present in the Accessories, and Clothing

Context Filters in Tableau 9

Remove Context Filters in Tableau

To remove Tableau context filters, Go to the Filter Shelf. Next, click on the down arrow beside the context filter that you want to remove. It will open the menu, and from that menu, please select the Remove from Context option.

Context Filters in Tableau 10

That removes the context filter in Tableau

Context Filters in Tableau 11

Placed Under: Tableau

  • Download and Install Tableau
  • Tableau Start Page
  • Tableau Show Me
  • Connect to MS Analysis Services
  • Connecting Tableau to SQL
  • Tableau Connect to Text File
  • Tableau Connect to Excel File
  • Hierarchies in Tableau
  • Tableau Bins
  • Tableau Parameters
  • Combined Tableau Sets
  • Tableau Set
  • How to Edit Tableau Group
  • Tableau Group
  • Tableau Grouping
  • Tableau First Report
  • Data Labels in Tableau Reports
  • Format Tableau Chart Title
  • Create Folders in Tableau
  • Tableau Sort
  • Add Totals in Tableau
  • How to Join Data in Tableau
  • Tableau Data Blending
  • Tableau Table Report
  • Tableau Crosstab Report
  • Tableau Annotations
  • Tableau Charts
  • Tableau Area Chart
  • Tableau Bar chart
  • Tableau Box Plot
  • Tableau Bubble Chart
  • Tableau Bullet Graph
  • Tableau Bump Chart
  • Tableau Circle Views
  • Tableau Dual Combination Chart
  • Tableau Dual Lines Chart
  • Tableau Funnel Chart
  • Tableau Traditional Funnel Chart
  • Tableau Gantt Chart
  • Tableau Grouped Bar Chart
  • Tableau Heat Map
  • Tableau Highlight Table
  • Tableau Histogram
  • Tableau Cumulative Histogram
  • Tableau Line Chart
  • Tableau Lollipop Chart
  • Tableau Pareto Chart
  • Tableau Pie Chart
  • Tableau Scatter Plot
  • Tableau Stacked Bar Chart
  • Tableau Text Label
  • Tableau Treemap
  • Tableau Word Cloud
  • Tableau Waterfall Chart
  • Tableau Individual Axis
  • Tableau Dual Axis
  • Tableau Blended Axis
  • Tableau Add Reference Lines
  • Tableau Add Reference Bands
  • Add Reference Distributions
  • Tableau Maps
  • How to Create a Map in Tableau
  • Use Google Maps in Tableau
  • Mapbox Maps as a Background
  • WMS Server Map as Background
  • Create a Tableau Dashboard
  • Format Dashboard Layout
  • Create Dashboard Device Prev
  • Tableau Dashboard Objects
  • Create a Tableau Story
  • Tableau Filters
  • Tableau Filters on Dimensions
  • Tableau Filters on Measures
  • Tableau Extract Filters
  • Tableau Dashboard Filters
  • Tableau Data Source Filters
  • Tableau Slicing Filters
  • Tableau Quick Filters
  • Tableau Context Filters
  • Tableau Top Filters
  • Tableau Table Calculations
  • Tableau Calculated Fields
  • Tableau Running Total
  • Tableau Rank Calculation Basic
  • Tableau Rank advanced calculate
  • Tableau Aggregate Functions
  • Tableau Conversion Functions
  • Tableau Case Function
  • Tableau Date Functions
  • Tableau If Function
  • Tableau Logical Functions
  • Tableau Math Functions
  • Tableau String Functions
  • Tableau Table Functions

Copyright © 2021 · All Rights Reserved by Suresh

About Us | Contact Us | Privacy Policy