Bird
Raised Fist0
Tableaubi_tool~15 mins

Dynamic dimension swap in Tableau - Real Business Scenario

Choose your learning style10 modes available

Start learning this pattern below

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
Scenario Mode
👤 Your Role: You are a sales analyst at a retail company.
📋 Request: Your manager wants a sales report where they can switch the view between sales by Region, Category, or Salesperson dynamically without creating multiple charts.
📊 Data: You have sales data including Date, Region, Category, Salesperson, and Sales Amount.
🎯 Deliverable: Create a Tableau dashboard with a single chart that changes its dimension based on a user selection parameter to show total sales by Region, Category, or Salesperson.
Progress0 / 5 steps
Sample Data
DateRegionCategorySalespersonSales Amount
2024-01-05NorthElectronicsAlice1200
2024-01-10SouthFurnitureBob850
2024-01-15EastElectronicsCharlie950
2024-01-20WestOffice SuppliesDiana400
2024-01-25NorthFurnitureAlice700
2024-02-01SouthElectronicsBob1100
2024-02-05EastOffice SuppliesCharlie300
2024-02-10WestFurnitureDiana650
2024-02-15NorthOffice SuppliesAlice500
2024-02-20SouthFurnitureBob900
1
Step 1: Create a parameter named 'Select Dimension' with string values: 'Region', 'Category', 'Salesperson'. Set default to 'Region'.
In Tableau, right-click in Data pane > Create Parameter > Name: Select Dimension > Data type: String > Allowable values: List > Add values: Region, Category, Salesperson > Set current value: Region
Expected Result
A parameter 'Select Dimension' appears allowing user to choose one of the three dimensions.
2
Step 2: Create a calculated field named 'Dynamic Dimension' that returns the field based on the parameter selection.
CASE [Select Dimension] WHEN 'Region' THEN [Region] WHEN 'Category' THEN [Category] WHEN 'Salesperson' THEN [Salesperson] END
Expected Result
A calculated field 'Dynamic Dimension' that changes its value based on the parameter.
3
Step 3: Build a bar chart with 'Dynamic Dimension' on Rows and SUM of 'Sales Amount' on Columns.
Rows: Dynamic Dimension Columns: SUM([Sales Amount]) Mark type: Bar
Expected Result
A bar chart showing total sales grouped by the selected dimension.
4
Step 4: Add the 'Select Dimension' parameter control to the dashboard for user interaction.
Right-click 'Select Dimension' parameter > Show Parameter Control
Expected Result
User can select 'Region', 'Category', or 'Salesperson' and the chart updates accordingly.
5
Step 5: Test the dashboard by switching the parameter values and verify the chart updates dynamically.
Select 'Category' in parameter > Chart updates to show sales by Category Select 'Salesperson' in parameter > Chart updates to show sales by Salesperson
Expected Result
Chart dynamically swaps dimension without needing multiple charts.
Final Result
Select Dimension: [Region | Category | Salesperson]

Dynamic Sales by Selected Dimension

| Dimension    | Total Sales |
|--------------|-------------|
| North        | 2400        |
| South        | 2850        |
| East         | 1250        |
| West         | 1050        |

(Bar chart bars proportional to sales values)
✓South region has the highest total sales among regions.
✓Furniture category is a strong performer when selected.
✓Salesperson Bob leads in total sales compared to others.
Bonus Challenge

Add a date filter to allow the manager to select a specific month or date range and see the dynamic dimension sales for that period.

Show Hint
Create a date parameter or use Tableau's date filter and apply it to the data source or worksheet to filter sales by the selected date range.

Practice

(1/5)
1. What is the main purpose of using a dynamic dimension swap in Tableau dashboards?
easy
A. To create multiple charts for each dimension
B. To fix the dimension so it cannot be changed
C. To let users change the chart categories interactively
D. To automatically refresh data sources

Solution

  1. Step 1: Understand dynamic dimension swap concept

    Dynamic dimension swap allows users to pick which dimension to display in a chart dynamically.
  2. Step 2: Identify the main benefit

    This makes dashboards interactive and saves space by avoiding multiple charts.
  3. Final Answer:

    To let users change the chart categories interactively -> Option C
  4. Quick Check:

    Dynamic dimension swap = interactive category change [OK]
Hint: Think: user controls which category to see [OK]
Common Mistakes:
  • Confusing dynamic swap with fixed dimensions
  • Thinking it creates multiple charts automatically
  • Assuming it refreshes data sources
2. Which Tableau feature is essential to implement a dynamic dimension swap?
easy
A. Calculated measure
B. Parameter
C. Data source filter
D. Dashboard action filter

Solution

  1. Step 1: Identify key components for dimension swap

    A parameter lets users select a value that controls which dimension to show.
  2. Step 2: Understand role of calculated field

    The calculated field uses the parameter to switch dimensions, but the parameter is the essential control.
  3. Final Answer:

    Parameter -> Option B
  4. Quick Check:

    Parameter controls dimension choice [OK]
Hint: Parameters let users pick options dynamically [OK]
Common Mistakes:
  • Choosing filters instead of parameters
  • Confusing calculated measures with parameters
  • Thinking dashboard actions swap dimensions
3. Given this calculated field for dynamic dimension swap:
CASE [Select Dimension]
  WHEN 'Category' THEN [Category]
  WHEN 'Region' THEN [Region]
  ELSE [Segment]
END

What will be the output if the parameter [Select Dimension] is set to 'Region'?
medium
A. Values from the Region field
B. Values from the Category field
C. Values from the Segment field
D. An error because ELSE is not needed

Solution

  1. Step 1: Analyze CASE statement with parameter value

    The CASE checks [Select Dimension]. If it is 'Region', it returns [Region].
  2. Step 2: Match parameter value to CASE branches

    Since parameter is 'Region', the output is values from the Region field.
  3. Final Answer:

    Values from the Region field -> Option A
  4. Quick Check:

    Parameter 'Region' returns Region field [OK]
Hint: Match parameter value to CASE WHEN branch [OK]
Common Mistakes:
  • Ignoring ELSE branch
  • Confusing field names
  • Thinking ELSE causes error
4. You created a parameter and calculated field for dynamic dimension swap but the chart does not update when you change the parameter. What is the most likely cause?
medium
A. The calculated field is not used in the view
B. The parameter is not connected to the data source
C. The data source filter is blocking the parameter
D. The parameter values are not numeric

Solution

  1. Step 1: Check parameter and calculated field usage

    For dynamic swap to work, the calculated field must be placed on Rows, Columns, or Marks.
  2. Step 2: Understand why chart doesn't update

    If the calculated field is not in the view, changing the parameter won't affect the chart.
  3. Final Answer:

    The calculated field is not used in the view -> Option A
  4. Quick Check:

    Calculated field missing in view stops update [OK]
Hint: Always add calculated field to the view [OK]
Common Mistakes:
  • Assuming parameter needs data source connection
  • Blaming filters without checking field usage
  • Thinking parameter values must be numeric
5. You want to create a dashboard where users can swap between three dimensions: 'Category', 'Region', and 'Segment'. You created a parameter with these values and a calculated field:
IF [Select Dimension] = 'Category' THEN [Category]
ELSEIF [Select Dimension] = 'Region' THEN [Region]
ELSE [Segment]
END

However, when users select 'Segment', the chart shows blank values. What is the best way to fix this?
hard
A. Use a CASE statement instead of IF/ELSEIF
B. Change the parameter to numeric values instead of text
C. Replace ELSE with ELSEIF [Select Dimension] = 'Segment'
D. Ensure the [Segment] field has no null or empty values

Solution

  1. Step 1: Identify why 'Segment' shows blanks

    If [Segment] has null or empty values, the chart will show blanks when selected.
  2. Step 2: Fix data quality issue

    Cleaning or filling nulls in [Segment] ensures values appear when selected.
  3. Final Answer:

    Ensure the [Segment] field has no null or empty values -> Option D
  4. Quick Check:

    Nulls in selected dimension cause blanks [OK]
Hint: Check for nulls in swapped dimension fields [OK]
Common Mistakes:
  • Changing parameter type unnecessarily
  • Replacing ELSE without reason
  • Thinking syntax change fixes data issues