Complete the calculation to create a parameter control for dynamic dimension selection.
CASE [[1]] WHEN 'Category' THEN [Category] WHEN 'Region' THEN [Region] ELSE [Segment] END
The parameter name controlling the dimension swap is typically called Selected Dimension.
Complete the calculated field to dynamically swap dimensions based on the parameter.
IF [Selected Dimension] = 'Category' THEN [[1]] ELSEIF [Selected Dimension] = 'Region' THEN [Region] ELSE [Segment] END
The first condition checks if the parameter equals 'Category', so the field returned must be Category.
Fix the error in this calculated field for dynamic dimension swap.
CASE [Selected Dimension] WHEN 'Category' THEN [Category] WHEN 'Region' THEN [1] ELSE [Segment] END
In Tableau calculations, fields must be enclosed in square brackets. So [Region] is correct.
Fill both blanks to complete the parameter and calculated field for dynamic dimension swap.
Parameter Name: [1] Calculated Field: IF [[2]] = 'Category' THEN [Category] ELSEIF [Selected Dimension] = 'Region' THEN [Region] ELSE [Segment] END
The parameter controlling the swap is named Selected Dimension, and the calculated field references it exactly.
Fill all three blanks to create a dynamic dimension swap with a parameter and calculated field.
CREATE PARAMETER [1] AS STRING VALUES: 'Category', 'Region', 'Segment' Calculated Field: CASE [[2]] WHEN 'Category' THEN [Category] WHEN 'Region' THEN [Region] ELSE [[3]] END
The parameter and calculated field reference must use the same name Selected Dimension, and the fallback field is Segment.