How to highlight the past, present and future automatically using Tableau

In this video we learn in Tableau Desktop how a simple calculated field can create a dimension, that can be applied to a charts colors and automatically highlight the past, present and future dates. This is a simple but powerful technique, enabling the viewers to infer that all of the data points should not be treated equally e.g. can’t affect the past, can affect the present, the future results haven’t happened yet. Otherwise your viewers might make incorrect assumptions about your charts, which can never work out well for anyone.

Copy and paste this equation into a calculated field in Tableau to create a new dimension:

IF DATEDIFF("quarter",[Date],TODAY()) > 0 THEN "Past"
    ELSEIF DATEDIFF("quarter",[Date],TODAY()) = 0 then "Present"
    ELSEIF DATEDIFF("quarter",[Date],TODAY()) < 0 then "Future"
END

Do you have a different technique to achieve this, a good example of it in action or if this helped you out somehow? Let me know in the comments below.

Share:

Leave a Reply

Your email address will not be published. Required fields are marked *

Table of Contents

Social Media:

Most Popular:

Related Posts

Datasaurus

Join the mailing list

Sign up to The Rawr newsletter to stay up to date on new content from the site and YouTube channel. 

Datasaurus

Join the mailing list

Sign up to The Rawr newsletter to stay up to date on new content from the site and YouTube channel.