Last Modified Date: 20 Jul 2023
Environment
Tableau DesktopAnswer
To create a grouped bar chart or side-by-side chart, ensure that the desired pill is set to Continuous so that the continuous field that anchors the horizontal location of each bar, forming the group.CLICK TO EXPAND SOLUTION
Example 1: Monthly Side by Side Bar Charts for Multiple Years
- In Tableau Desktop, connect to Superstore sample data.
- Drag Sales to the Rows shelf.
- Drag Order Date to the Columns shelf.
- On the Columns shelf, right-click YEAR(Order Date), and then select Month (May).
- Drag Order Date to the Columns shelf again.
- On the Marks card, select Bar from the drop-down menu.
- Drag Order Date to the Color card.
CLICK TO EXPAND STEPS
Example 2: Using a Dimension
Step 1: Create a calculated field
- Create a calculated field: Select Analysis > Create Calculated Field.
- In the Calculated Field dialog box, complete the following steps.
- For Name, type Market List.
- In the Formula box, build the following formula:
CASE [Market]
WHEN "Central" THEN 1
WHEN "East" THEN 2
WHEN "South" THEN 3
WHEN "West" THEN 4
ELSE 4.5
END
- Confirm that the status message indicates that the formula is valid, and then click OK.
Step 2: Build the view
- Drag "Product Type" to the Columns.
- Right-click "Market List" and select Convert to Dimension.
- Right-click "Market List" and select Convert to Continuous.
- Drag "Product type" and "Market List" to Columns.
- Drag "Inventory" to the Rows.
- On the Marks card, on the drop-down list of view types, select Bar.
- Drag "Market" to Color.
Step 3: Adjust the bar sizes:
- Click the Size mark card.
- Select Fixed so that Tableau Desktop automatically adjusts the size to minimum and the maximum default data.
- (Optional step) Right-click the x axis and unselect "Show Header" if you do not want to display the Quarters. Or, right-click the axis and select Edit Axis... > Remove the title.
Note: the video has no sound.
CLICK TO EXPAND STEPS
Example 3: Stacked Side-by-side Bar Charts
- Drag at least 3 fields (at least one measure and one dimension) to the Rows & Columns. In this specific example, we will drag: States to Columns, Profit and Margin to Rows.
- Click the Side-by-side Show Me Bar Chart example.
- Replace Measure Values from Colors by a Dimension to Color. In this example, Product Type was used.
Note: the video has no sound.
CLICK TO EXPAND STEPS
Example 4: Stacked with Dates
Step 1: Build the view:
- Drag "Market" to Columns.
- Right-click and drag "Date" to Columns.
- In the pop-up window, select QUARTER(Date) as a continuous measure.
- Drag "Inventory" to Rows.
- Filter the view to the 2005 Year.
- Add "Product Type" to Color.
- Change the chart to Bar Chart.
Step 2: Adjust the bar sizes:
If the bar charts are not grouped, follow the below steps:- Click the Size mark card.
- Select Fixed so that Tableau Desktop automatically adjusts the size to minimum and the maximum default data.
- (Optional step) Right-click the x axis and unselect "Show Header" if you do not want to display the Quarters. Or, right-click the axis and select Edit Axis... > Remove the title.
Note: the video has no sound.
CLICK TO EXPAND STEPS
Example 5: Dual Axis & Stacked
Step 1: Build the view:
- Drag Month(Order Date) to Columns.
- Drag Sum(Discount) to Rows.
- Drag Sum(Sales) to Rows.
- Right-click Sum(Sales) and select Dual Axis.
- Drag Measure Names to Columns.
- Under Marks > All select Bar.
Step 2: Add colors
- Select Marks > Sum(Discount).
- Place Region on Color.
- Select Marks > (Sum(Sales).
- Place Product Sub-Category on Color.
Note: the video has no sound.
CLICK TO EXPAND STEPS
Additional Example: Side-by-side chart combined with a continuous line chart
The ability to create a grouped or side-by-side bar chart combined with a continuous line chart is not currently built in Tableau Desktop. To voice your support for the future implementation of such a feature, please vote on the following ideas:
Additional Information
For alternative workarounds, please see the following publication from a Tableau Zen Master: Drawing with Numbers.Thank you for providing your feedback on the effectiveness of the article.
Open new Case
Continue Searching
Knowledge Base
Community
Product Help
Training and Tutorials