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.
Build a map visual using [State]. Set the view to filled map.
Create one column in an excel spreadsheet with the values “Sales” and “Profit”. Connect to the excel datasource.
Right click your parameter column, and select “Create Parameter”
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
Use your selector sheet, and map visual on a dashboard.
Add a parameter action. Source sheet is your selector sheet. Set your parameter field to affect the selector parameter.