DEV Community

Punitha
Punitha

Posted on

Parameters in Tableau

What is a Parameters?

  • A Parameter is a dynamic value that allows users to change data, calculations, filters, or charts interactively.

Why Use Parameters?

  • Change calculations dynamically.

  • Create interactive dashboards.

  • Switch between charts.

  • Filter data.

  • Change measures (Sales, Profit, Quantity).

Example: Parameter for Sales and Profit

Suppose you have two measures:

  • Sales

  • Profit

Using a parameter, users can switch between:

Sales
or
Profit
Enter fullscreen mode Exit fullscreen mode

How to Create a Parameter

Step 1: Open Tableau

  • Open Tableau and connect your dataset.

Step 2: Go to Data Pane

  • On the left side, right-click anywhere in the Data Pane.

Click:

Create Parameter
Enter fullscreen mode Exit fullscreen mode

Step 3: Enter Parameter Details

Example:

Property               Value

Name                   Select Measure
Data Type              String
Allowable Values       List
Enter fullscreen mode Exit fullscreen mode

Step 4: Add Values

Add values:

Sales
Profit
Quantity
Enter fullscreen mode Exit fullscreen mode

Click OK.

Step 5: Show Parameter

Right-click the parameter.

Click:

Show Parameter
Enter fullscreen mode Exit fullscreen mode

You will see:

Sales
Profit
Quantity
Enter fullscreen mode Exit fullscreen mode

Create Calculated Field for Parameter

Go to:

Analysis → Create Calculated Field
Enter fullscreen mode Exit fullscreen mode

Name:

Selected Measure
Enter fullscreen mode Exit fullscreen mode

Formula:

CASE [Select Measure]

WHEN "Sales" THEN SUM([Sales])

WHEN "Profit" THEN SUM([Profit])

WHEN "Quantity" THEN SUM([Quantity])

END
Enter fullscreen mode Exit fullscreen mode

Click OK.

Step 6: Use in Chart

Drag:

Category → Rows

Selected Measure → Columns
Enter fullscreen mode Exit fullscreen mode

Now users can switch:

Sales
Profit
Quantity
Enter fullscreen mode Exit fullscreen mode

The chart changes automatically.

Parameter Flow

Create Parameter
        ↓
Add Values
        ↓
Show Parameter
        ↓
Create Calculated Field
        ↓
Use in Chart
        ↓
Interactive Dashboard
Enter fullscreen mode Exit fullscreen mode

Top comments (0)