Evolytics Blog

Tableau Fundamentals: 5 Ways to Make a Bar Chart / An Intro to Aggregation

5 Ways to Make a Tableau Bar Chart FeatureNow that we’ve gone through some fundamental topics such as dimension vs. measure, discrete vs. continuous, and you have an overview of the authoring interface, you’re ready to start creating visualizations in Tableau. This post shares five different ways to create a bar chart and provides an introduction to the topic of aggregation.

Perhaps the most important lesson from this post is a line I hear myself saying almost every day: there is always more than one way to do something in Tableau. You will find your own techniques, form your own habits, and hear different opinions – and they likely will all have merit. You truly can take multiple paths to get to the same end result in Tableau. We are about to discuss five different ways to create a bar chart, and it’s not even a comprehensive list!

This tutorial will be using the Sample – Superstore data set in Tableau and will show five techniques for creating a bar chart out of the Sales measure.

Five Ways to Create a Bar Chart in Tableau
  1. The easiest way to start a bar chart in Tableau is to simply double-click on the measure you want to visualize from the Measures Shelf. By default, this will place a continuous pill for Sales on the Rows Shelf, which creates a vertical bar.
  2. You could have got to this same place by left-clicking and dragging the Sales measure from the Measures Shelf to the Rows Shelf.
  3. ‘Pre-select’ the Sales measure by clicking on it, then click ‘horizontal bars’ in the Show Me options. This creates a different orientation than the first two approaches because the Sales measure is placed on the Columns Shelf instead of the Rows Shelf. If you prefer the vertical orientation, you can click the Swap icon (pictured below), use the Ctrl+W shortcut, or drag and drop the Sales measure from the Columns Shelf to the Rows Shelf.

Swap Rows Tableau

  1. You can change the mark type on an existing view to Bar. Let’s say you are looking at the Sales measure by Year of Order Date as a line graph. You can convert the line graph to a bar chart by changing the mark type on the Marks Shelf from Automatic (line) to Bar.

Line to Bar Mark Type Tableau

  1. Similar to approach 2 above, but if you right-click and drag the Sales measure from the Measures shelf to the Rows Shelf, you will be presented with the option to choose the data aggregation before the bar chart is created.

Tableau Aggregation

An Introduction to Aggregation in Tableau

Every measure on a view in Tableau is aggregated in some way. It can be easy to not notice this when you’re getting started because the default aggregation is SUM, and that works for most situations. Look back at the views created through our five approaches above; the Sales measure is preceded by the word SUM to show you how the field is being aggregated. There are several other aggregation options in Tableau, and the choice will influence your analysis. Here is a list of some of the options and the results you can expect to see for each choice (using the Sales measure):

SUM: All of the sales added up together

AVG: All of your sales added up, divided by the number of records

MEDIAN: When sorted, the sales amount for the record in the exact middle of your data

CNT: A count of all records with sales

CNTD: A count of distinct sales amounts

MIN: The smallest sales value in your data

MAX: The largest sales value in your data

Knowing that there are always multiple approaches to the same solution in Tableau and having an understanding of aggregation will help tremendously as we start working with different visualizations and creating calculated fields in future posts.

Ryan Sleeper

Ryan Sleeper is a data visualization evangelist specializing in Tableau. To learn more about how Evolytics' award-winning data visualization practice can help you with your Tableau dashboards or training needs, contact us.

Ryan SleeperTableau Fundamentals: 5 Ways to Make a Bar Chart / An Intro to Aggregation

Related Posts