Help users compare different sales metrics dynamically by selecting which measure to display in the chart and KPI cards.
0
0
Dynamic measure swap in Tableau - Dashboard Guide
Dashboard Mode - Dynamic measure swap
Dashboard Goal
Sample Data
| Region | Product | Sales | Profit | Quantity Sold |
|---|---|---|---|---|
| East | Widget | 1000 | 200 | 50 |
| West | Widget | 1500 | 300 | 70 |
| East | Gadget | 1200 | 250 | 60 |
| West | Gadget | 1300 | 270 | 65 |
| East | Doohickey | 900 | 180 | 40 |
| West | Doohickey | 1100 | 220 | 55 |
Dashboard Components
- Parameter:
Choose Measurewith options: Sales, Profit, Quantity Sold - Calculated Field:
Selected Measurewith formula:CASE [Choose Measure]
WHEN 'Sales' THEN SUM([Sales])
WHEN 'Profit' THEN SUM([Profit])
WHEN 'Quantity Sold' THEN SUM([Quantity Sold])
END - KPI Card: Shows total
Selected Measureacross all data.
Example: If 'Sales' selected, KPI shows 7000 (sum of all Sales) - Bar Chart: Displays
Selected MeasurebyRegion.
Bars show sum of selected measure per region. - Table: Shows
Product,Region, andSelected Measurevalues for detailed view.
Dashboard Layout
+----------------------+----------------------+ | KPI Card | Parameter | | (Total Selected | (Choose Measure) | | Measure Value) | | +----------------------+----------------------+ | Bar Chart (Selected Measure by Region) | +-------------------------------------------------------------------------------+ | Detailed Table (Product, Region, Selected Measure) | +-------------------------------------------------------------------------------+
Interactivity
The Choose Measure parameter lets users pick which metric to analyze: Sales, Profit, or Quantity Sold.
When the parameter changes, the Selected Measure calculated field updates accordingly.
This update refreshes the KPI card, bar chart, and detailed table to show the chosen measure's values.
All visuals stay synchronized, providing a seamless dynamic measure swap experience.
Self Check
If you select Profit in the Choose Measure parameter, what is the total value shown in the KPI card?
Answer: 200 + 300 + 250 + 270 + 180 + 220 = 1420
Which regions show the highest and lowest bars in the bar chart?
Answer: West region has higher total profit (300 + 270 + 220 = 790) than East (200 + 250 + 180 = 630).
Key Result
Interactive dashboard allowing users to swap between Sales, Profit, and Quantity Sold measures dynamically across KPI, bar chart, and table.