Change values in a filter based on Parameter selection in Tableau

Home Change values in a filter based on Parameter selection in Tableau

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

Comment

Enrollment Form

Start your Journey by Enrolling in our Training Program

Learning Path By

Change values in a filter based on Parameter selection in Tableau

Enrollment Form

Start your Journey by Enrolling in our Training Program

Course Details

Program

Change values in a filter based on Parameter selection in Tableau

Training Format
(Online/In class)

In class

Preferred days / Timings (Weekdays/Weekends)

10 am - 12 pm
Weekend

Enrollment Form

Start your Journey by Enrolling in our Training Program