Change values in a filter based on Parameter selection in Tableau

Parameters provide good functionality in Tableau and help in creating interactive dashboards. In this article, we will learn how to change values in a filter, based on Parameter selection in Tableau.

I will first explain what I mean by changing the values in a filter, based on a parameter selection.

Suppose, giving a dataset, we have a list of customers who purchase items from online, in-store and by making phone calls. The data source contains sales for each of these purchases.

In this scenario, based on the selection made in parameter ‘Type of Order’, values in the filter ‘Customers’ should change.

List of Customers based on Type of Order
Customers who made purchases Online

In the above figure, when ‘Type of Order’ is Online, names of ‘Customers’ who made online purchase will be displayed.

How to change values in a filter based on Parameter selection

To achieve the above functionality, follow the below steps. This example uses the following dataset:

Tables used – Customers, Online Sales, Store Sales and Call Sales

Steps:

  1. Create a parameter – ‘Type of Order’ for each order types – Online, Store and Call. Learn how to create a parameter
Creating Parameter
Parameter Type of Order

2. Create a calculated field – ‘Customers’ to use this parameter. In the below code, Type of Order is the parameter created in the previous step.

IF [Type of Order] = “Online” THEN [Online]
ELSEIF [Type of Order] = “Store” THEN [Store]
ELSEIF [Type of Order] = “Call” THEN [Call]
END

3. Create another calculated field – ‘Sales Display’ to display Sales for each ‘Type of Order’ parameter in the chart

If [Type of Order] = ‘Online’ then [Sales (Online)]
ELSEIF [Type of Order] = ‘Store’ then [Sales (Store)]
ELSEIF [Type of Order] = ‘Call’ then [Sales]
End

4. Create a bar chart by using the calculated field ‘Customers’ on Rows and ‘Sales Display’ on Columns.

5. Right-click on calculated field Customers and select Show Filters. More on filters.

Right-click on the parameter Type of Order and select Show Parameter.

Values in filter Customer changes based on Parameter selection
Bar chart displaying Online Sales by Customers

If you select ‘Store’ in ‘Type of Order’ parameter, the ‘Customers’ list and chart will display the Store Sales.

Values in filter changing based on the Parameter selection
Bar chart displaying Store Sales by Customers

More on Parameters in Tableau


About the Author

Chandraish Sinha has  20+ years of experience in Information Technology. He is an accomplished author and has published 11 books covering Business Intelligence related topics such as, Tableau,Power BI, and Qlik. Checkout his Amazon Author profile.

His latest book Excel Basics to Advanced covers all the aspects of MS Excel and provides exercises for self-learning.

Similarly, his recent book, Dashboarding with Tableau, covers all the features in Tableau and includes exercises for self-learning.

He has implemented IT solutions in different domains viz. Pharmaceutical, Healthcare, Telecom, Financial and Retail.

He blogs regularly on various IT topics. Check them out in the links given below: 

Blogs

Learn Tableau

Learn All Bi

Related posts

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.