Creating a Dynamic Bar Chart in Tableau with Parameters and Calculated Fields
- Aditya Kumbhavdekar

- May 8
- 2 min read
Updated: May 29
In this Tableau tutorial, you’ll learn how to use parameters and calculated fields to create a dynamic bar chart. This chart allows users to switch between different dimensions — Segment, Region, or Ship Mode — with a simple dropdown.
This powerful technique adds flexibility and interactivity to your dashboards. Best of all, it eliminates the need for multiple charts or worksheets, saving you time and complexity.
We’ll use Tableau’s popular Global Superstore dataset to plot Sales against the dimension selected by the user.
Download the dataset here:
🛠️ Step-by-Step Guide: Build a Dynamic Bar Chart in Tableau
🔸 Step 1: Create a Parameter
Right-click in the Data pane and select Create Parameter.
Name it: Choose Dimensions.
Set Data Type to String.
Allowable values should be set to: List.
Add the following values:
Segment
Region
Ship Mode
Click OK.
Right-click the parameter and select Show Parameter.
🔸 Step 2: Create a Calculated Field
Right-click in the Data pane and select Create Calculated Field.
Name it: Chosen Dimension.
Use the following CASE statement to configure it:
Here’s the snippet you can use:
```plaintext
CASE [Choose Dimensions]
WHEN 'Segment' THEN [Segment]
WHEN 'Region' THEN [Region]
WHEN 'Ship Mode' THEN [Ship Mode]
END
```
Click OK.
Right-click on the newly created parameter and select Show Parameter. The parameter will then appear on the left side of the canvas.
🔸 Step 3: Build the Dynamic Bar Chart
Drag Chosen Dimension to the Columns.
Drag Sales to the Rows.
Sort the chart in descending order for better readability.
You can add color, labels, or tooltips as needed for additional context and clarity.
💡 Tip: Visibility Matters
Make sure the parameter control is visible on your dashboard. This allows users to switch between dimensions interactively, enhancing their experience.
Benefits of This Method
Utilizing parameters and calculated fields to create a dynamic bar chart offers several advantages:
Cleaner Dashboards: You won’t need multiple worksheets to display various dimensions. It simplifies your dashboard design.
Interactive User Experience: Users have greater control over what they see. They can switch dimensions at their convenience, making data exploration easier.
Scalable Design: If you need to add more dimensions later, it’s simple to do. The existing setup will accommodate new data points without hassle.
🎥 Want to See It in Action?
Check out our step-by-step video tutorial here: 👈 Watch on YouTube
Keep Learning with Think Data with Tableau
This tutorial is just one among many practical Tableau skills you can learn here. Follow the Think Data with Tableau blog and YouTube channel for more follow-along tutorials and dashboard inspiration.
Website: www.thinkdatawithtableau.com
YouTube: Think Data with Tableau
LinkedIn: Follow us here
Was this blog Insightful/Helpful? Please cast your vote
Was this Insightful / Helpful?
Yes
No

Comments