Tableau Shortcut: Use Tableau’s Last Function to Show the Latest Data

One challenge you will likely have when using Tableau is that once your analysis is found to be useful, your audience will want to see regular updates. This isn’t the most fun or beneficial task, but luckily we can automate some of those updates. Changing the filter on the data points shown in your analysis can be time-consuming, so this Shortcut will show you how to use the Last function to always show the latest data relevant to the analysis you’re doing.

The Last function values each mark made on the screen relevant to how far it is to the latest data point. The chart shows data from Tableau’s demo dataset, Superstore. The values shown in the figure are the sum of sales broken down by each month over the four year dataset. I’ve added a calculation containing the Last function h to the Text part of the Marks card to annotate a value to each mark. I’ll show you how to do this in just a moment.

The Last function annotating each monthly sales total
Figure 1. The Last function annotating each monthly sales total

The main thing to note about the Last function is that it counts how many data points each mark is away from the last mark within the view. The Last function is a table calculation in Tableau, as it is one of the last things calculated by the software. This means the Last function will only calculate ...

Get Use Tableau's Last Function to Show the Latest Data now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.