Parameters in Tableau
Parameters are one of the most powerful and flexible features in Tableau. They allow you to inject user-selected values directly into calculations, filters, reference lines, and even dashboard titles — transforming static reports into dynamic, interactive analytical tools.
This chapter covers everything from creating your first parameter to building sophisticated what-if analysis models used in real business environments.
What Are Parameters?
A parameter in Tableau is a workbook variable that replaces a constant value. Instead of hard-coding a number, string, or date into a calculation or filter, you allow the viewer to supply that value at runtime.
How Parameters Differ from Filters
Many beginners confuse parameters with filters. While both allow interaction with the data, they serve fundamentally different purposes.
| Feature | Filter | Parameter |
|---|---|---|
| Purpose | Restricts which rows of data appear | Passes a value into a calculation, filter, or visual element |
| Works on | The data set (rows) | A formula or visual property |
| Data connection | Tied to a field in the data source | Independent of any field — it's a workbook variable |
| Multiple values | Yes (include/exclude multiple values) | Only one value at a time (single-select) |
| Used in | Filter shelf, context filters | Calculated fields, reference lines, titles, filters |
| Visible control | Filter card | Parameter control (separate UI element) |
Example to illustrate the difference:
A filter on Region = "East" removes all non-East rows from your view. A parameter called [Selected Region] set to "East" does nothing by itself — you must use it inside a calculation such as IF [Region] = [Selected Region] THEN [Sales] END to give it meaning.
This distinction is critical. Parameters give you the flexibility to use the same underlying data in many different ways without touching the data itself.
Creating a Parameter
To create a parameter in Tableau Desktop, right-click anywhere in the Data pane (the left panel showing your fields) and select Create Parameter. Alternatively, go to Analysis → Create Calculated Field, then in the formula bar reference a new parameter.
The Create Parameter dialog has the following fields:
Name
Give your parameter a descriptive name that will be visible to end users. Use names like [Metric Selector], [Top N Products], or [Target Revenue] — avoid cryptic abbreviations.
Data Type
The data type determines what kind of values the parameter can hold.
| Data Type | Example Values | Common Use Cases |
|---|---|---|
| Integer | 5, 10, 100 | Top N filtering, year selection |
| Float | 0.05, 1.25, 99.9 | Discount rates, price multipliers |
| String | "Sales", "East", "Blue" | Metric selectors, region toggles |
| Boolean | True / False | Toggle switches, show/hide logic |
| Date | 2024-01-01 | Date range start/end |
| Date & Time | 2024-01-01 08:00:00 | Timestamp-based filtering |
Current Value (Default)
This is the value the parameter holds when a viewer first opens the workbook. Choose a sensible default — typically the most common use case or a middle-ground value.
Allowable Values
This setting controls what values the user can pick.
| Option | Description | Best For |
|---|---|---|
| All | No restriction — user types any value | Flexible inputs, advanced users |
| List | Predefined list of values | Metric selectors, category toggles |
| Range | Min, max, and step size | Numeric sliders, date ranges |
List option details:
- You can type values manually or click Add from Field to populate the list from an existing dimension.
- Each list entry can have a separate Display As label (e.g., value = "SUM_SALES", display = "Total Sales").
Range option details:
- Set a Minimum and Maximum value.
- Set a Step Size — how much the value changes each increment (e.g., step 1 for integers, step 0.01 for percentages).
- Set a Display Format for how the value appears in the control (e.g., currency, percentage).
Showing a Parameter Control
Creating a parameter does nothing visible until you expose it to the user. Right-click the parameter in the Data pane and select Show Parameter Control. This adds a control to your view.
Control Types
Right-click the parameter control header (the small dropdown arrow on the control card) to change the display style:
| Control Type | Appearance | Best For |
|---|---|---|
| Slider | Horizontal drag handle | Numeric ranges, smooth adjustment |
| Type In | Text input box | Free-form values, exact numbers |
| Single Value List | Radio buttons | Short lists (<6 items) |
| Compact List | Dropdown menu | Lists with many items |
| Multiple Values List | Checkbox list | (only for certain custom setups) |
Tip: For metric selectors (Sales / Profit / Quantity), use Single Value List — it shows all options at once and is immediately scannable. For Top N (1–20), use Slider — it's more intuitive for numeric ranges.
Using Parameters in Calculations
The most common use of parameters is inside calculated fields. The parameter acts like a variable that your formula can reference.
Example 1: Dynamic Metric Selector
Goal: Let the user switch the primary metric between Sales, Profit, and Quantity without changing the view structure.
Step 1: Create a String parameter named [Metric Selector] with Allowable Values = List:
- Sales
- Profit
- Quantity
Current Value: Sales
Step 2: Create a calculated field named [Selected Metric]:
IF [Metric Selector] = "Sales" THEN [Sales]
ELSEIF [Metric Selector] = "Profit" THEN [Profit]
ELSEIF [Metric Selector] = "Quantity" THEN [Quantity]
END
Step 3: Place [Selected Metric] on the Rows shelf (as a measure). Place [Sub-Category] on Rows or Columns. Show the parameter control. Now the viewer can toggle between metrics and the bar chart updates instantly.
Example 2: Dynamic Date Granularity
Goal: Switch the time axis between Year, Quarter, and Month.
Step 1: Create a String parameter [Date Granularity] with List values: Year, Quarter, Month.
Step 2: Create a calculated field [Dynamic Date]:
IF [Date Granularity] = "Year" THEN DATETRUNC('year', [Order Date])
ELSEIF [Date Granularity] = "Quarter" THEN DATETRUNC('quarter', [Order Date])
ELSEIF [Date Granularity] = "Month" THEN DATETRUNC('month', [Order Date])
END
Step 3: Place [Dynamic Date] as a continuous date on Columns. The timeline now zooms in or out based on user selection.
Parameters in Filters
Parameters can drive dynamic filter conditions through calculated fields placed on the Filter shelf.
Top N by Parameter
Goal: Show only the top N products by sales, where N is user-controlled.
Step 1: Create an Integer parameter [Top N] with Range: Min=1, Max=20, Step=1. Current Value=10.
Step 2: Create a calculated field [Top N Filter]:
RANK(SUM([Sales])) <= [Top N]
Step 3: Place [Top N Filter] on the Filter shelf, edit the filter to show only True. Change the computation to be addressed by Product Name (use Table Calculation settings).
Now dragging the Top N slider from 5 to 15 instantly expands the visible products.
Dynamic Date Range Filter
Goal: Let users set a start date and end date with parameters.
Step 1: Create two Date parameters: [Start Date] and [End Date].
Step 2: Create a calculated field [In Date Range]:
[Order Date] >= [Start Date] AND [Order Date] <= [End Date]
Step 3: Place [In Date Range] on the Filter shelf and filter to True.
Step 4: Show both parameter controls. Users now have a date range picker that filters dynamically.
Parameters in Reference Lines
Reference lines help viewers compare a data point to a target or benchmark. Using a parameter makes that benchmark interactive.
Adding a Parameter-Driven Reference Line
Step 1: Create a Float parameter [Sales Target] with Allowable Values = All. Set current value to 50000.
Step 2: In your view (e.g., a bar chart of Sales by Region), right-click the Sales axis and select Add Reference Line.
Step 3: In the Add Reference Line dialog:
- Set Line to Value → select
[Sales Target] - Set Label to Custom: "Target: "
- Set formatting (dashed line, red color)
Step 4: Show the [Sales Target] parameter control with a Type In input.
Now viewers can type their own target value and immediately see which regions are above or below it. This is extremely common in sales performance dashboards.
Parameters in Titles and Tooltips
Parameters can be embedded in dynamic text using the <Parameters.ParameterName> syntax.
Dynamic Title
Double-click the view title to open the title editor. Type your title and insert the parameter by going to Insert → Parameters → [Metric Selector]. This inserts a placeholder like <Parameters.Metric Selector>.
Example title: Top Products by <Parameters.Metric Selector> — <Parameters.Top N> Shown
When the user switches the metric to "Profit" and sets N to 7, the title automatically reads: Top Products by Profit — 7 Shown
Dynamic Tooltip
Click Tooltip in the Marks card. Insert parameter values alongside field values:
Product: <Product Name>
<Parameters.Metric Selector>: <SUM(Sales)>
Target: <Parameters.Sales Target>
Parameter Actions (Tableau 2019.2+)
Parameter Actions allow a dashboard action (clicking, hovering, or selecting a mark) to set a parameter value — no manual control interaction required.
This enables a completely new paradigm: clicking a bar or data point drives the rest of the dashboard.
How Parameter Actions Work
Go to Dashboard → Actions → Add Action → Change Parameter. Configure:
| Setting | Description |
|---|---|
| Source Sheets | Which sheet triggers the action |
| Run action on | Select, Hover, or Menu |
| Target Parameter | Which parameter to update |
| Source Field | Which field value gets written into the parameter |
| Clearing the selection | What value the parameter resets to |
Step-by-Step: Parameter-Driven Highlight Dashboard
Scenario: A regional sales dashboard where clicking a region name highlights only that region's data across all charts.
Step 1: Create a String parameter [Selected Region] with Allowable Values = List populated from the Region field. Current value = "East".
Step 2: Create a calculated field [Is Selected Region]:
[Region] = [Selected Region]
Step 3: In each sheet on your dashboard, place [Is Selected Region] on the Color shelf. Set True = blue, False = light gray.
Step 4: Create a separate sheet showing just Region names as text marks (a simple list).
Step 5: On the dashboard, go to Dashboard → Actions → Add Action → Change Parameter:
- Source Sheet: Region List sheet
- Run action on: Select
- Target Parameter:
[Selected Region] - Source Field: Region
Step 6: Now clicking "West" in the region list updates [Selected Region] to "West", which updates the color calculation on every sheet simultaneously — creating a focused, cross-dashboard highlight effect.
What-If Analysis with Parameters
What-if analysis is where parameters truly shine. By letting users manipulate assumptions, you transform a static report into a decision-support tool.
Model 1: Discount Impact Calculator
Business question: If we increase our average discount rate, how does it affect profit?
Step 1: Create a Float parameter [Discount Rate] with Range: Min=0.00, Max=0.50, Step=0.01. Format as percentage. Current value = current average discount.
Step 2: Create a calculated field [Adjusted Profit]:
[Sales] * (1 - [Discount Rate]) - [Cost]
If [Cost] is not in your data, approximate:
[Sales] * (1 - [Discount Rate]) - ([Sales] - [Profit])
Step 3: Create a dual-axis chart with original profit (bars) and adjusted profit (line). The slider lets executives see profitability at any discount rate instantly.
Model 2: Price Elasticity Model
Business question: If we raise prices by X%, how does it affect revenue assuming demand drops proportionally?
Step 1: Create a Float parameter [Price Change %] with Range: -0.30 to 0.30, Step=0.01. Format as percentage.
Step 2: Create a Float parameter [Elasticity] with Range: -3.0 to 0.0, Step=0.1. Current value = -1.2 (typical price elasticity of demand).
Step 3: Create calculated field [Adjusted Revenue]:
[Sales] * (1 + [Price Change %]) * (1 + [Elasticity] * [Price Change %])
Step 4: Plot original vs adjusted revenue on a time series. Users can explore the revenue impact of pricing decisions before committing.
Model 3: Headcount Planning Scenario
Business question: If we hire N additional salespeople at an average quota of Q, what is the expected revenue impact?
Step 1: Integer parameter [New Hires], Range 0–50.
Step 2: Float parameter [Avg Quota Per Rep], Range 0–500000, Step=10000.
Step 3: Calculated field [Projected Revenue Uplift]:
[New Hires] * [Avg Quota Per Rep]
Step 4: Show this as a reference band or text on your revenue forecast chart. Leaders can model the ROI of hiring decisions in seconds.
Parameters vs Sets vs Filters: Decision Guide
| Scenario | Use |
|---|---|
| Show only certain dimension members | Filter |
| Allow user to pick which members to show | Filter with Show Filter control |
| Compare selected vs all others | Set |
| Drive a calculation with a user value | Parameter |
| Top N (user-controlled) | Parameter + Calculated Field on Filter |
| Dynamic axis metric | Parameter + Calculated Field |
| Target/benchmark line | Parameter + Reference Line |
| Click a mark to update other views | Parameter Action |
| Fixed cohort comparison | Set |
| Date range selection | Parameters (start & end) or Filter |
Decision rule: If the user's selection needs to change a number, formula, or text — use a Parameter. If it needs to show/hide rows — use a Filter. If it needs to compare a selected group to the rest — use a Set.
Practice Exercises
Exercise 1: Metric Toggle Bar Chart
Using the Superstore dataset:
- Create a String parameter
[KPI Selector]with list values: Sales, Profit, Quantity. - Create a calculated field
[Selected KPI]that returns the corresponding measure. - Build a horizontal bar chart of Sub-Category vs
[Selected KPI]. - Sort bars descending by
[Selected KPI]. - Add a dynamic title that reflects the selected KPI.
Challenge: Add color to the bars that changes based on whether each sub-category is above or below the average of [Selected KPI].
Exercise 2: Interactive Top N Dashboard
Using the Superstore dataset:
- Create an Integer parameter
[Top N Products]with Range 1–20. - Create a Rank calculation to filter to the top N products by Sales.
- Build a bar chart of Product Name vs Sales showing only the Top N.
- Add a reference line at the average Sales of all products (not just the top N — use a fixed value or a separate calculation).
Challenge: Add a second parameter for [Bottom N Products] and create a view that shows both the top N and bottom N simultaneously.
Exercise 3: What-If Profit Scenario
Using the Superstore dataset:
- Create a Float parameter
[Cost Reduction %](0% to 30%, step 1%). - Create
[Adjusted Profit]=[Profit] + [Sales] * [Cost Reduction %]. - Build a dual-axis chart showing original Profit (bars) and Adjusted Profit (line) by month.
- Color the line green when Adjusted Profit > Profit, and blue otherwise (this should always be true given the formula, so think about how to test edge cases).
Challenge: Add a text annotation showing the total uplift in profit: [Adjusted Profit] - [Profit] summed across all visible data.
Exercise 4: Parameter Action Click-Through
Using the Superstore dataset:
- Create a String parameter
[Selected Sub-Category]. - Create a calculated field
[Is Selected]=[Sub-Category] = [Selected Sub-Category]. - Build a scatter plot of Sales vs Profit colored by
[Is Selected]. - Build a bar chart of Category vs Sales also colored by
[Is Selected]. - Assemble both onto a dashboard.
- Create a Parameter Action: clicking a bar in the bar chart sets
[Selected Sub-Category]to the clicked sub-category. - Test: clicking "Chairs" in the bar chart should highlight Chair marks in the scatter plot.
Summary
Parameters are Tableau's most versatile interactive element. Unlike filters that restrict data, parameters inject a user-controlled value into calculations, filters, reference lines, and text.
Key takeaways from this chapter:
- Parameters have a data type, a default value, and allowable values (All, List, or Range).
- You must show the parameter control for users to interact with it, and you can style it as a slider, dropdown, list, or text box.
- Parameters become powerful when connected to calculated fields — this is what makes metric selectors, dynamic axes, and scenario models work.
- In filters, parameters drive Top N analysis and dynamic date ranges.
- In reference lines, parameters create adjustable benchmark lines.
- In titles and tooltips, the
<Parameters.Name>syntax makes text dynamically responsive. - Parameter Actions (Tableau 2019.2+) allow clicking a mark to set a parameter — enabling cross-sheet highlighting and drill-down experiences.
- What-if analysis models (discount impact, price elasticity, headcount planning) are built by connecting parameters to calculated fields that model business scenarios.
Master parameters and you gain the ability to build truly adaptive, self-service analytical tools that empower business users to answer their own questions.