Tableau: Use Parameter Actions to Swap Metrics

Updated: May 13, 2021

Parameter actions are a powerful tool to swap metrics in Tableau. A parameter action can be added to most sheets within a dashboard or within the sheet itself.

Step 1:

Build a map visual using [State]. Set the view to filled map.

Step 2:

Create one column in an excel spreadsheet with the values “Sales” and “Profit”. Connect to the excel datasource.

Step 3:

Right click your parameter column, and select “Create Parameter”

Step 4:

Write a calculation to swap out your metric based on the value in your parameter. Use that field as color on the map visualization.

if [Selector] = "Sales" then sum([Sales])

elseif [Selector] = "Profit" then sum([Profit]) END

Step 6:

Use your selector sheet, and map visual on a dashboard.

Step 7:

Add a parameter action. Source sheet is your selector sheet. Set your parameter field to affect the selector parameter.

92 views0 comments