Jump into concepts and practice - no test required
or
Recommended
Test this pattern10 questions across easy, medium, and hard to know if this pattern is strong
Recall & Review
beginner
What is a dynamic measure swap in Tableau?
A dynamic measure swap lets you switch between different measures in a single view using a control like a parameter, so you can compare or analyze data without creating multiple charts.
Click to reveal answer
beginner
How do you create a dynamic measure swap in Tableau?
You create a parameter listing the measures, then a calculated field that uses the parameter to choose which measure to show. Finally, you use this calculated field in your view.
Click to reveal answer
intermediate
Why use a parameter instead of filters for dynamic measure swap?
Parameters let you swap measures dynamically in one chart without filtering data out, keeping all data available and improving user experience.
Click to reveal answer
intermediate
What is a calculated field example for dynamic measure swap?
Example: IF [Measure Parameter] = 'Sales' THEN SUM([Sales]) ELSEIF [Measure Parameter] = 'Profit' THEN SUM([Profit]) ELSE SUM([Quantity]) END
Click to reveal answer
beginner
What is a common use case for dynamic measure swap?
It helps business users quickly compare different metrics like sales, profit, or quantity in the same chart without switching dashboards.
Click to reveal answer
What Tableau feature is essential for creating a dynamic measure swap?
ADashboard Action
BFilter
CData Source
DParameter
✗ Incorrect
Parameters allow users to select which measure to display dynamically.
Which Tableau element uses the parameter to show the selected measure?
ATooltip
BCalculated Field
CColor Legend
DFilter Shelf
✗ Incorrect
A calculated field uses the parameter value to decide which measure to display.
What is the main benefit of dynamic measure swap?
ASwitching between measures without multiple charts
BFiltering data by date
CChanging data source
DAdding more rows to the table
✗ Incorrect
It lets users switch measures in one chart, saving space and improving analysis.
Which of these is NOT a step in creating a dynamic measure swap?
Identify the error in this dynamic measure swap calculated field:
CASE [Measure Selector]
WHEN 'Sales' THEN SUM(Sales Amount)
WHEN 'Profit' THEN SUM(Profit Margin)
END
medium
A. Missing square brackets around field names
B. Parameter name is incorrect
C. CASE statement syntax is invalid
D. SUM function cannot be used inside CASE
Solution
Step 1: Check field name syntax
In Tableau, field names must be enclosed in square brackets, e.g., [Sales Amount], [Profit Margin].
Step 2: Identify error in code
The code uses SUM(Sales Amount) and SUM(Profit Margin) without brackets, causing syntax error.
Final Answer:
Missing square brackets around field names -> Option A
Quick Check:
Field names need [ ] in SUM() [OK]
Hint: Always use [ ] around field names in calculations [OK]
Common Mistakes:
Omitting brackets around field names
Assuming CASE syntax is wrong
Thinking SUM can't be inside CASE
5.
You want to create a dashboard where users can switch between SUM([Sales]), AVG([Profit]), and COUNT([Orders]) using one parameter called [Measure Choice]. Which calculated field correctly implements this dynamic measure swap?
?
hard
A. CASE [Measure Choice]
WHEN 'Sales' THEN SUM([Sales])
WHEN 'Profit' THEN AVG([Profit])
ELSE 0
END
B. CASE [Measure Choice]
WHEN 'Sales' THEN SUM([Sales])
WHEN 'Profit' THEN AVG([Profit])
WHEN 'Orders' THEN COUNT([Orders])
END
C. SWITCH([Measure Choice], 'Sales', SUM([Sales]), 'Profit', AVG([Profit]), 'Orders', COUNT([Orders]))
D. IF [Measure Choice] = 'Sales' THEN SUM([Sales]) ELSEIF [Measure Choice] = 'Profit' THEN AVG([Profit]) ELSE 0 END
Solution
Step 1: Check parameter values and measures
The parameter has three values: 'Sales', 'Profit', and 'Orders'. Each must map to the correct aggregation.
Step 2: Verify calculated field syntax
CASE [Measure Choice]
WHEN 'Sales' THEN SUM([Sales])
WHEN 'Profit' THEN AVG([Profit])
WHEN 'Orders' THEN COUNT([Orders])
END uses CASE with explicit WHEN for all three values and correct aggregations, matching the parameter choices exactly.
Final Answer:
CASE [Measure Choice]
WHEN 'Sales' THEN SUM([Sales])
WHEN 'Profit' THEN AVG([Profit])
WHEN 'Orders' THEN COUNT([Orders])
END -> Option B
Quick Check:
CASE with all WHENs matches parameter values [OK]
Hint: Use CASE with all parameter options explicitly listed [OK]
Common Mistakes:
Using ELSE instead of explicit WHEN for all options