pbPassingBI
/
Calculations intermediate 8 min

Parameters

User-controlled variables, and the swap patterns that make dashboards feel interactive.

What you'll be able to do
  • Create a parameter and reference it in a calculation
  • Build a measure swap and a dynamic top N
  • Explain how parameters differ from filters

What a parameter is

A parameter is a single user-controlled value — a number, date, string or boolean. On its own it does nothing. It only has an effect when referenced by a calculation, filter, reference line, or set.

That indirection is the point: one control can drive several different behaviours at once.

Parameters vs. filters

A filter reads its values from the data and restricts rows directly. A parameter holds a value you define and does nothing until something references it.

Consequences: parameters don't update when the data changes (a new region won't appear automatically), and classic parameters accept only a single value. Filters can be multi-select and are data-aware. Newer Tableau versions add dynamic parameters that refresh their list on workbook open, which closes part of that gap.

Dynamic top N

Create an integer parameter Top N with a range of 5 to 50. On the Filters shelf, set a Top filter by field and choose the parameter instead of a fixed number.

Show the parameter control and users can dial the list length themselves — one control, no extra sheets.

Measure swap

Create a string parameter listing Sales, Profit, Quantity. Then write:

CASE [Select Measure] WHEN 'Sales' THEN SUM([Sales]) WHEN 'Profit' THEN SUM([Profit]) ELSE SUM([Quantity]) END

Put that calculation on Rows. One chart now serves three metrics. The same trick with a dimension-returning CASE gives you a dimension swap, which is how you build a single chart that pivots between Category, Region and Segment.

Key points
  • A parameter does nothing until a calculation, filter or reference line uses it
  • Classic parameters are single-value and not data-aware; dynamic parameters refresh on open
  • CASE on a string parameter is the standard measure/dimension swap pattern
Check yourself