Line charts in Tableau – Exploring Charts, Graphs, and Dashboards

Another simple use case for Tableau and Salesforce is to track campaigns over time. In this specific example, we would like to track how much we spent on our campaigns versus the budget we set. To do so we will start by selecting Actual Cost in Campaign from our Measures list and drag it into Rows as shown in Figure 4.9:

Figure 4.9: Tracking campaign costs compared to budget using Tableau and Salesforce

This has now created a vertical bar chart. And while we now know that we have spent almost £35,000 on our campaigns, we need more information. Therefore, we will now select Budgeted Cost in Campaign and drag it on the Actual Cost in Campaign axis. The cursor will change to show two green bars, as shown in Figure 4.10:

Figure 4.10: A vertical bar chart comparing Budgeted Cost and Actual Cost in Campaign

We will now drop our field onto the axis, and Tableau will add this measure to the visualization so that we will now see the Actual Cost and the Budgeted Cost side by side in two bars as shown in Figure 4.11:

Figure 4.11: Side-by-side bars showing Actual Cost and Budgeted Cost

To facilitate comprehension, Tableau will automatically assign a different color to each measure. So now we know that our budgeted and actual expenses align, but was that the case throughout the campaigns?

To answer this final question, we will select End Date and drop it on top of the Measure Names pill in Columns as shown in Figure 4.12:

Figure 4.12: End Date dropped onto Measure Names in Columns for final question resolution.

Tableau will by default choose to display the year of the date of our choice. It may make sense in some cases, but not in this one. Therefore, we will click on the End Date blue pill and select the second month on the list as shown in Figure 4.13:

Figure 4.13: Choosing the second month on the End Date blue pill in Tableau.

We will discuss dates in Tableau in the next chapters, where we will go through more complex visualizations. After you have selected the correct date, your chart will look as in Figure 4.14:

Figure 4.14: Exploring dates and charting in Tableau’s next chapters

We can now see that while we started below our budget, as the campaign progressed, we went over our planned expense. It is probably good that our campaigns did not run for long.