EDUCBA

EDUCBA

MENUMENU
  • Free Tutorials
  • Free Courses
  • Certification Courses
  • 360+ Courses All in One Bundle
  • Login

Stacked Bar Chart in Tableau

By Priya PedamkarPriya Pedamkar

Home » Data Science » Data Science Tutorials » Tableau Tutorial » Stacked Bar Chart in Tableau

Stacked bar chart

Introduction to Stacked Bar Chart in Tableau

Stacked Bar Chart in Tableau is a tool that is used for visualization. It is used for visually analyzing the data. A person can create an interactive sharable dashboard using Stacked Bar Chart in Tableau and that dashboard can be used to depict trends, variations in data using graphs and charts. It is not open source but a student version is available. The interesting part about it is that it allows real-time data analysis. It can be used to connect to files, big data sources. Its demand for growth is being used in academics, business, and many government organizations.

Now let’s discuss what a stacked bar chart is? So, a Stacked Bar Chart is a bar chart that not only compares different categories of data in a graphical fashion but it also has the capability to break down the whole and compare parts of the whole. Each segment in the bar represents different categories of the whole.

Start Your Free Data Science Course

Hadoop, Data Science, Statistics & others

Now let’s begin the process of preparing a Stacked Bar Chart using Tableau. Before we begin let’s first know the difference between dimension and measures in a tableau dashboard as it is very important and will help us to understand easily.

So what is a measure and dimension in tableau?

The answer is Tableau divides the data into two parts. Dimensions are fields that cannot be aggregated or contain qualitative values (name, geographical data, dates) while measures are fields that can be aggregated and can be used for mathematical operations.

Stacked Bar Chart in Tableau

Below are the different approach to create a stacked bar chart in tableau:

Approach 1

  1. Open Tableau and you will find the below screen.
  2. Connect to a file using the connect option present in the Tableau landing page. In my case, I have an excel file to connect. Select the excel option and browse your file to connect.

Stacked BAr Chart in Tableau

  1. I am using office supplies dataset which has six attributes and includes both numeric and categorical values. The below screenshot shows how it looks in tableau once you connect to your sheet. If you look closely there are two attributes (Units and Unit Price) in the measurement region and four (Region, Rep, Item, Date) in the dimension region.

Stacked BAr Chart in Tableau 2

  1. Click on sheet1 shown with the tooltip ”Go to Worksheet”. This is where you will prepare your visualizations. The below screenshot shows how it looks.

Stacked Bar Chart in Tableau 13

  1. If we drag and drop one of the variables from measure region for example Units in our case. It will aggregate to the default sum and once you drag and drop them a bar chart will be created. The below screenshot illustrates this.

Stacked Bar Chart in Tableau 3

  1. Now, if we want to create a proper bar chart we can create that by dragging and dropping one of the dimension regions into the column region. In our case, we can use the dimension “Item” for that purpose. Once we drag and drop the Item dimension into the column section. We will see a bar graph where each bar will represent a particular name/brand of the item and the height of the bar will represent sum (aggregate) of Units for that class of the car. In this below Screenshot, we can see the same has been illustrated.

Stacked Bar Chart in Tableau 4

  1. Now to create a properly stacked bar graph, we would need a segment. In our case, we can use the Region as a proper segment. So what region will do is it will divide the names of items based on the region from where it belongs. In our dataset, we have three regions namely East, West and central. To make these fairly attractive and recognizable, we are going to drag “Region” from dimension region to marks card. Once we drag the “Region” to marks card, we will get to see the stacked Tableau chart.

Stacked Bar Chart in Tableau 5

Now let’s try to create a Stacked Bar Chart using a second approach. This approach will be a little different at the end but will give the same result.

Approach 2

  1. All steps from step 1 to step 6 will remain the same in the second approach as well. The step will change from step 7.
  2. In this case, let us first remove the segment “Region” from a color shelf and place the “Region” in the column section right beside “Item” from dimension region. So once we drag and drop “region” from the color shelf to the Column section. We will see the below bar graph in Tableau.

Stacked Bar Chart in Tableau 6

  1. Now after getting the above graph, we have to convert the bar graph to Stacked Bar Graph and for that, we need to see the previous screenshot above where there is a button called show me button in the top right corner. The show-me button provides various graphs and charts and a user can choose any of the applicable graphs. The applicable graphs will be highlighted. The below screenshot shows the “Show Me” button.

Show Me button

  1. As you can see above the Stacked Bar Graph is highlighted and we just have to click on the stacked bar graph and a stacked bar graph similar to approach 1 will be created as shown below.

bar graph similar to approach 1

Interesting Points

  1. We can add labels to the stacked bar graph by clicking on the “Show Mark Labels” button situated in the toolbar. Once we click on that we will be able to add mark labels on our graph as shown below.

Show Mark Labels

  1. Another way of bringing the levels would be to drag and drop one of the data labels from measures or dimensions pane to level shelf present in marks card. In our case, we wanted to set the number of units as labels. So, we drag and dropped the “Unit” label from measures pane into the labels shelf.

labels shelf

  1. The interesting feature in Tableau is that if you select any specific stack, it shows you the details of that particular stack.
  2. We can also remove any particular stack from the stacked bar graph. For that just select the stack you want to remove and press exclude on the dialog box that appears and that stack gets removed from the graph. In our case, we removed the top right corner stack from our graph.

bar graph

Recommended Articles

This is a guide to Stacked Bar Chart in Tableau. Here we have discussed the basic concept and different approach to create a stacked bar chart in tableau with Screenshots. You can also go through our other suggested articles to learn more –

  1. Treemap in Tableau
  2. Gantt chart in Tableau
  3. How to Connect Database to PHP?
  4. Introduction to Line Chart in Tableau
  5. How to Create JavaFX Bar Chart with Program?

Data Visualization Training (15 Courses, 5+ Projects)

15 Online Courses

5 Hands-on Projects

105+ Hours

Verifiable Certificate of Completion

Lifetime Access

Learn More

0 Shares
Share
Tweet
Share
Primary Sidebar
Tableau Tutorial
  • Charts
    • Tableau Charts
    • Tableau Chart Types
    • Donut Chart in Tableau
    • Funnel Chart in Tableau
    • Gantt Chart in Tableau
    • Bubble Chart in Tableau
    • Pareto Chart in Tableau
    • Sankey Chart In Tableau
    • Stacked Bar Chart in Tableau
    • Tableau Bullet Chart
    • Waterfall Chart in Tableau
    • Line Chart in Tableau
    • Heat Map in Tableau
    • Histogram in Tableau
    • CrossTab in Tableau
    • Treemap in Tableau
    • Trend Lines in Tableau
    • Tableau Reference Lines
    • Tableau Dual Axis
    • Legend in Tableau
    • Pie Chart in Tableau
    • Tableau Storyline
  • Basic
    • What is Tableau
    • What is Tableau Dashboard
    • What is Tableau Server
    • Uses of Tableau
    • Tableau Versions
    • Tableau Architecture
    • Is Tableau Free
    • Tableau New Features
    • How To Install Tableau
    • How to Use Tableau?
    • Install Tableau Server
    • Tableau Commands
  • Statement
    • Tableau IF Statement
    • Case Statement in Tableau
  • Functions
    • Tableau Functions
    • Tableau String Functions
    • Concatenate in Tableau
    • Rank Function in Tableau
    • Tableau Aggregate Functions
    • Tableau Date Functions
    • Window Sum Tableau
    • LOD Expressions in Tableau
    • LOOKUP Function in Tableau
    • Tableau Fixed Function
    • Tableau Count Distinct
    • Tableau Window Functions
  • Sort/Filters
    • Sorting in Tableau
    • Filters in Tableau
    • Types of Filters in Tableau
    • Tableau Action Filter
    • Context Filter in Tableau
    • Tableau Parameter Filter
    • Adding Filters in Tableau Dashboard
    • Tableau Context Filter
  • Tableau Dashboard
    • Dashboard in Tableau
    • Tableau Dashboard Creation
    • Tableau Dashboard Design
    • Tableau Workbook
  • Advanced
    • Tableau Reporting
    • Tableau Reporting Tool
    • Conditional Formatting in Tableau
    • Data Blending in Tableau
    • Parameters in Tableau
    • Tableau Data Sets
    • Tableau Drill Down
    • Tableau Dynamic Parameters
    • Tableau Table Calculation
    • Tableau Visualization
    • Tableau Joins
    • Pivot in Tableau
    • Data Visualization With Tableau
    • Forecast in Tableau
    • Map Layers in Tableau
    • Group in Tableau
    • Tableau Group by
    • Hierarchy in Tableau
    • Sets in Tableau
    • How to create a Set in Tableau
    • Tableau Order of Operations
    • Tableau User Group
    • Tableau Calculated Field
    • Custom SQL in Tableau
  • Interview Questions
    • Tableau Interview Questions

Related Courses

Tableau Certification Course

Business Intelligence Courses

Data Visualization Courses

Footer
About Us
  • Blog
  • Who is EDUCBA?
  • Sign Up
  • Corporate Training
  • Certificate from Top Institutions
  • Contact Us
  • Verifiable Certificate
  • Reviews
  • Terms and Conditions
  • Privacy Policy
  •  
Apps
  • iPhone & iPad
  • Android
Resources
  • Free Courses
  • Database Management
  • Machine Learning
  • All Tutorials
Certification Courses
  • All Courses
  • Data Science Course - All in One Bundle
  • Machine Learning Course
  • Hadoop Certification Training
  • Cloud Computing Training Course
  • R Programming Course
  • AWS Training Course
  • SAS Training Course

© 2020 - EDUCBA. ALL RIGHTS RESERVED. THE CERTIFICATION NAMES ARE THE TRADEMARKS OF THEIR RESPECTIVE OWNERS.

EDUCBA Login

Forgot Password?

EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you
Book Your One Instructor : One Learner Free Class

Let’s Get Started

This website or its third-party tools use cookies, which are necessary to its functioning and required to achieve the purposes illustrated in the cookie policy. By closing this banner, scrolling this page, clicking a link or continuing to browse otherwise, you agree to our Privacy Policy

EDUCBA

*Please provide your correct email id. Login details for this Free course will be emailed to you
EDUCBA
Free Data Science Course

Hadoop, Data Science, Statistics & others

*Please provide your correct email id. Login details for this Free course will be emailed to you

Special Offer - Data Visualization Training (15 Courses, 5+ Projects) Learn More