KNOWLEDGE BASE

Creating a Grouped Bar Chart

Product(s): Tableau Desktop
Version(s): All

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.

Step 1

Select Analysis > Create Calculated Field.

Step 2

In the Calculated Field dialog box, complete the following steps.

1. For Name, type Region Position.
2. In the Formula box, build the following formula:

```CASE [Region] WHEN "Central" THEN 2 WHEN "East" THEN 2.5 WHEN "South" THEN 3 WHEN "West" THEN 3.5 ELSE 4 END```

3. Confirm that the status message indicates that the formula is valid, and then click OK.

Set up the view

Step 1

From the Dimensions pane, drag Category onto the Columns shelf.

Step 2

In the Measures pane, right-click Region Position and select Convert to Dimension.

Step 3

In the Dimensions pane, right-click Region Position and select Convert to Continuous.

Step 4

From the Dimensions pane, drag Region Position to the Columns shelf.

Step 5

From the Measures pane, drag Sales onto the Rows shelf.

Step 6

On the Marks card, on the drop-down list of view types, select Bar.

Step 7

From the Dimensions pane, drag Region to Color on the Marks card.

Step 8

On the Marks card, click Size, and then drag the slider all the way to the right to widen the bars.

Step 9

Right-click the x-axis and select Edit Axis.

Step 10

In the Edit Axis dialog box, make the following changes:

1. Under Range, select Fixed.
2. Set Start to 1 and End to 4.5.

3. Click OK.

Step 11

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