Last Modified Date: 16 Aug 2016
Article Note: This article is no longer actively maintained by Tableau. We continue to make it available because the information is still valuable, but some steps may vary due to product changes.
A grouped bar chart shows comparisons vividly and in a way that can be taken in at a glance.
This example uses the Superstore sample to show you how to create the calculation that enables this view.
Create a calculated field
A calculated field provides the environment you need to create this view. For a grouped bar chart, you need a continuous field that anchors the horizontal location of each bar, forming the group.
Select Analysis > Create Calculated Field.
In the Calculated Field dialog box, complete the following steps.
- For Name, type Region Position.
- In the Formula box, build the following formula:
WHEN "Central" THEN 2
WHEN "East" THEN 2.5
WHEN "South" THEN 3
WHEN "West" THEN 3.5
- Confirm that the status message indicates that the formula is valid, and then click OK.
Set up the view
From the Dimensions pane, drag Category onto the Columns shelf.
In the Measures pane, right-click Region Position and select Convert to Dimension.
In the Dimensions pane, right-click Region Position and select Convert to Continuous.
From the Dimensions pane, drag Region Position to the Columns shelf.
From the Measures pane, drag Sales onto the Rows shelf.
On the Marks card, on the drop-down list of view types, select Bar.
From the Dimensions pane, drag Region to Color on the Marks card.
On the Marks card, click Size, and then drag the slider all the way to the right to widen the bars.
Right-click the x-axis and select Edit Axis.
In the Edit Axis dialog box, make the following changes:
- Under Range, select Fixed.
- Set Start to 1 and End to 4.5.
- Click OK.
Right-click the x-axis and click Show Header to clear the selection.
Hide the International region to see a more meaningful view for the US regions. In the Region card, right-click International and select Hide.
Alternate Search Terms:How To Calculations