Chapter 78. How to Automatically Highlight the Latest Trends
This tutorial illustrates how to add a highlighter to the most recent data point on a line graph. You also can dynamically color this highlighter to communicate that the latest trend was either positive or negative. This technique provides several benefits, such as orienting your end users, communicating positive and negative performance changes at a glance, and enhancing the dashboard design.
To highlight the latest trend, letâs use the trick from Chapter 63 in Practical Tableau (OâReilly, 2018), âHow to Highlight a Dimension.â Even though we can add reference lines to dates, we will need to get a little hackier to produce the effect weâre looking for. In this exercise, we combine this trick with a calculated field to automatically turn on the highlighter for the most recent month in our analysis and color it to communicate a positive or negative change.
First, Iâm going to lay the foundation for the chart by making a Sales by continuous Month line graph from the Sample â Superstore dataset:
Next, letâs create a calculated field that will eventually draw a bar for the most recent month being visualized. Hereâs the formula:
IF ATTR(DATETRUNC( 'month',[Order Date])) = WINDOW_MAX(ATTR(DATETRUNC( 'month',[Order ...
Get Innovative Tableau 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.