0
0
Tableaubi_tool~5 mins

Dynamic dimension swap in Tableau - Step-by-Step Guide

Choose your learning style9 modes available
Introduction
Dynamic dimension swap lets you change which dimension a chart uses without rebuilding it. This helps you explore data from different angles quickly by swapping categories on the fly.
When you want to let users choose to view sales by product category or by region in the same chart
When you have a dashboard that should show data by different time periods like month or quarter without duplicating charts
When you want to compare customer segments or product lines using the same visualization
When you want to save space by using one chart that can switch between different dimensions
When you want to create interactive reports that adapt to user choices
Steps
Step 1: Create a parameter
- Data pane → right-click → Create Parameter
A new parameter dialog opens
💡 Name it clearly, like 'Select Dimension'
Step 2: Set parameter data type and allowable values
- Create Parameter dialog
Parameter options are ready for user selection
💡 Choose 'String' type and list dimension names as values
Step 3: Create a calculated field to switch dimensions
- Data pane → right-click → Create Calculated Field
Calculated field dialog opens
💡 Use CASE or IF statements to return the selected dimension
Step 4: Enter calculation using parameter
- Calculated Field dialog
Calculated field returns values based on parameter choice
💡 Example: CASE [Select Dimension] WHEN 'Category' THEN [Category] WHEN 'Region' THEN [Region] END
Step 5: Replace dimension on Rows or Columns shelf with calculated field
- Worksheet view
Chart updates to use the dynamic dimension
💡 Remove original dimension to avoid confusion
Step 6: Show parameter control
- Right-click parameter → Show Parameter Control
Parameter dropdown appears on the worksheet
💡 Users can now select which dimension to view
Before vs After
Before
Chart shows sales by Category only with Category on Columns shelf
After
Chart updates to show sales by Region or Category based on parameter selection, with dynamic dimension on Columns shelf
Settings Reference
Parameter Data Type
📍 Create Parameter dialog
Defines the type of values the parameter can hold
Default: String
Allowable Values
📍 Create Parameter dialog
Limits the choices users can select in the parameter
Default: List
Calculated Field Formula
📍 Create Calculated Field dialog
Defines logic to switch between dimensions based on parameter
Default: CASE
Common Mistakes
Using original dimensions on the view along with the calculated field
This causes confusion and the chart does not update properly when swapping
Remove original dimensions and use only the calculated field for the dynamic dimension
Not showing the parameter control
Users cannot change the dimension without the control visible
Right-click the parameter and select 'Show Parameter Control' to enable user interaction
Parameter values do not exactly match dimension names
Calculated field logic fails if names differ, causing errors or blank results
Ensure parameter list values exactly match the dimension names used in the calculation
Summary
Dynamic dimension swap lets you change chart categories without rebuilding visuals
It uses a parameter and a calculated field to switch dimensions interactively
Remember to remove original dimensions and show the parameter control for users