This is a post about getting the output you want, despite what Tableau thinks.
This is a post about making Tableau do what Excel can do (whether it’s a good idea or not).
This is a post about gaining better understanding of dimensions, measures, continuous, and discrete.
This is a post about putting bars and lines on the same chart.
Getting bars and lines on the same chart can be as easy as dragging and dropping a few pills, or as difficult as a lot of custom calculations and SQL hacking. What in Excel might take three clicks – select the series, click on the Chart Type button on the Ribbon Bar, choose the specific chart type – in Tableau could take a few clicks, or a whole lot of typing.
This is due to very different design philosophies between the two applications, the key difference being that Tableau generates the view from attributes of the data, which gives Tableau tremendous power, whereas in Excel you can just select cells A2, B2, and C48926 and tell Excel to draw a grouped bar chart. In Tableau, is the distinction between those three values based on a Dimension like Region, or are you looking to plot three different Measures like Sales, Profit, and Budgeted Sales? That distinction matters when you are looking to put bars and lines in the same view, so here’s a quick overview.
In Tableau, there are Dimensions – columns of values within the data that are used to partition the view; and Measures – columns of values whose exact displayed value in the view depends upon the chosen set of Dimensions. Both Dimensions and Measures can be Discrete – blue pills, having categorical values that generate headers in the view; or Continuous – green pills, having a continuous range of values that generate axes in the view. To help understand this better, check out these posts by Tom Brown: http://www.theinformationlab.co.uk/2011/09/23/blue-things-and-green-things/ and Joe Mako: http://www.thedatastudio.co.uk/blog/the-data-studio-blog/groundwork-for-custom-table-calculations.
Once you have an understanding of how your data is represented in Tableau, and have an idea of the combined chart you want to build, then you can use the handy The “So You Want Bars and Lines on the Same Tableau Chart?” Flowchart (PDF):
To understand the decision points, here’s the 2nd page of the PDF:
Each of the worksheets described is in the following Tableau Public workbook, along with instructions on how to set up the worksheet and prepare the data.
The genesis of this post has been the series of questions on the Tableau forums about building combined bar and line charts, and hopefully this resource will help take care of future questions. So another person to thank for this is Larry Wall, who came up the the three virtues.
If you’ve found other (easier?) ways to do this, or have questions, please let me know!