Exercise: Make a Bar Chart in Tableau

AVG Profit by Region

In this self-guided exercise, you will use what you’ve learned about aggregation and various ways to make a bar chart in Tableau to create your first data visualization.

Hi, this is Ryan with Playfair Data TV. And in this exercise, you’re going to recreate this bar chart. The format for these exercises is I’m going to show you a chart type that’s related to the topics that we discussed. What I would do is pause the video and take a shot at recreating it. I will then follow up and show you how to build this.

So the first chart type that we’re going to make here is a bar chart. Notice on the y-axis that our measure is profit. But we see the aggregation AVG, which is short for average. If you ever see an aggregation that’s something other than the default. That means that you need to change the aggregation when you create the view. If it was just the default aggregation, you wouldn’t see the word AVG. It would just have the sum of profit there.

So average profit is our measure. We’re then going to break that measure down by a dimension called region. Region is drawing a column for each of the dimension members, which should be a big clue on where to put the region dimension. This point, I’d pause the video. See if you can recreate it.

All right, I’m going to recreate this for us now. So if I were to approach this situation. I always start with my measure. And because I see that there is a different aggregation than the default. I’m going to use the shortcut of right clicking on the measure and dragging it to either the columns or rows shelf.

I saw that the measure of profit was drawing a row, which is telling me I need to put the profit measure on the rows shelf. But because I’m holding down the right mouse key, before it draws anything, it will give me this option to choose something other than the default aggregation. I’m going to choose AVG profit, click OK. And the last thing was just to make a column for each of my regions.

Keyword column, that’s also giving me a clue on where to put that dimension. I can left click region, drag it to the columns shelf. And I’ve recreated my bar chart. Notice that the y-axis is not in dollar amounts. There’s two ways I could change that.

One, is I can change the default formatting, so that profit is always in currency. I can do that by right clicking profit, hovering over default properties, clicking number format, and choosing one of these options, currency standard or currency custom. Currency standard’s usually a good option. If you don’t like the decimal places, you could do currency custom and just move this down to zero, click OK. And notice on the y-axis there’s dollar signs now.

Could have also changed the default or the formatting for just the numbers on this view, I’m going to undo it to get rid of my default formatting. If you ever want to change the formatting of just the numbers on the view, but not permanently set the default formatting. You can also right click on the measure that you’re wanting to change, click Format.

And you’ve got two choices. You can change the numbers on the axis or the pane. The axis is just like it sounds, like that’s the y-axis. In this case, the numbers on the pane would be the numbers within that view. So not on the axis, but within the view, on the marks perhaps.

But by default, we’re in the right spot. Axis, and we’re just looking for this dropdown numbers, click Numbers. I’ll do currency custom again and bump the decimals down to zero. But that’s how to get through this exercise in a couple of different ways in Tableau.

This has been Ryan with Playfair Data TV – thanks for watching!