01 / 20

Tableau
Parameters

Learn how to create and use parameters to give your Tableau dashboards dynamic interactivity: controlling calculations, filters, and visual behavior on the fly.

Tableau

What Is a Parameter?

A parameter in Tableau is a workbook variable that holds a single value: a number, a string, a date, or a boolean. Unlike fields that come from your data source, a parameter is a value that you define and that users can change at runtime.

Why Parameters Matter

★ Interactivity
Let users explore data by choosing thresholds, dates, or measures without editing the workbook.
★ Flexibility
One calculated field can serve multiple purposes by referencing a parameter instead of a hard-coded value.
★ Reusability
Parameters are workbook-level: every sheet and dashboard can reference the same parameter.

Anatomy of a Parameter

Parameter: Sales Threshold Name Sales Threshold Data Type Integer Current Value 5000 Allowable Values Range: 0 to 50000 Display as: Slider Unique identifier User can change Constrains input

The Core Rule of Parameters

Parameter Calculated Field Filter / Set Reference Line Viz

The parameter is the input. It must flow through a calculated field, a filter, or a reference line before the visualization changes.

Parameter Data Types

Data Type Example Value Common Use Case
Integer 5000 Top N, thresholds
Float 0.15 Profit margin, rates
String "Sales" Measure swapping
Date 2024-01-01 Date range control
Boolean TRUE Toggle features on/off

Parameters vs Filters

Feature Parameter Filter
Source of values You define them Data source
Number of values Exactly one One or many
Cross-sheet? Yes, by default Only if applied globally
Affects query? Only via calculated field Directly
Auto-updates? Not automatically Yes

How to Create a Parameter

1
Right-click in the Data pane and select Create Parameter.
2
Name the parameter descriptively, e.g. "Select Metric" or "Top N".
3
Choose the data type (Integer, Float, String, Date, or Boolean).
4
Set allowable values: All, List (specific entries), or Range (min, max, step).
5
Set the current value (the default when the workbook opens).
6
Click OK, then right-click the parameter and choose Show Parameter to display its control on the sheet.

Example 1: Top N Filter

Goal: Let the user choose how many products to show in a bar chart. We create a parameter called Top N of type Integer with a range of 1 to 20.

Parameter: Top N 1 20 5
\( \text{INDEX}() \le [\text{Top N}] \)
Calculated Field (Filter) Top 5 Products by Sales A B C D E

Example 2: Measure Swapper

Goal: Let users toggle a line chart between Sales, Profit, and Quantity using a single parameter.

// Parameter: "Select Metric" (String, List)
// Allowable values: "Sales", "Profit", "Quantity"

// Calculated Field: "Dynamic Metric"
CASE [Select Metric]
  WHEN "Sales" THEN [Sales]
  WHEN "Profit" THEN [Profit]
  WHEN "Quantity" THEN [Quantity]
END

Example 3: Dynamic Reference Line

Goal: Add a reference line to a scatter plot whose position the user controls. Create a Float parameter called "Goal Line" with a range of 0 to 100,000.

Sales Profit Goal: $50K Goal Line = 50K

Allowable Values: All, List, Range

All
Users can type any value of the chosen data type. Useful for free-form text input or exploratory analysis.
List
Users select from predefined values (e.g., "Sales", "Profit"). Best for measure swapping or category selection.
Range
Users pick a number between min and max with a step size. Displayed as a slider. Best for numeric thresholds.

Parameters in Calculated Fields

Parameters appear in the calculation editor under their own section. Reference them by wrapping the name in square brackets:

// Threshold-based color
\( \text{IF } [\text{Sales}] \ge [\text{Sales Threshold}] \)
  THEN "Above Target"
  ELSE "Below Target"
END
// Date window calculation
\( [\text{Order Date}] \ge [\text{Start Date}] \)
AND
\( [\text{Order Date}] \le [\text{End Date}] \)

Parameter Actions

Since Tableau 2019.2, Parameter Actions let you update a parameter's value by clicking a mark in a visualization, not just using a control widget.

1
Go to Dashboard > Actions > Add Action > Change Parameter.
2
Select the source sheet (which sheet the user clicks on).
3
Choose the target parameter and the source field whose value will be written into it.
4
Set the interaction trigger: Select, Hover, or Menu.

Common Mistakes

✕ Forgetting to Show
Creating a parameter but never right-clicking to Show Parameter. Users can't change a value they can't see.
✕ Wrong Data Type
Using a String parameter when you need a number. The \( \text{IF } [\text{Sales}] \ge [\text{Param}] \) comparison will fail silently.
✕ No Calculated Field
Dragging a parameter to Rows/Columns expecting it to act like a field. Parameters must be referenced in a calc or filter.

Summary Cheat Sheet

Pattern Parameter Type Key Calculated Field
Top N Integer, Range \( \text{INDEX}() \le [\text{Top N}] \)
Measure Swap String, List \( \text{CASE } [\text{Param}] \)
Reference Line Float, Range No calc needed
Date Window Date, All \( [\text{Date}] \ge [\text{Start}] \)
What-If Analysis Float, Range \( [\text{Sales}] \times [\text{Growth Rate}] \)

Question 1 of 5

What must happen before a parameter can change the appearance of a visualization in Tableau?

Question 2 of 5

You want users to toggle between "Sales", "Profit", and "Quantity". Which parameter configuration is best?

Question 3 of 5

How many values can a Tableau parameter hold at one time?

Question 4 of 5

A student creates an Integer parameter with a Range of 1 to 10 and drags it onto the Columns shelf. What happens?

Question 5 of 5

Which Tableau feature (introduced in 2019.2) allows a parameter's value to change when a user clicks a mark in a viz?