A tiny Tableau tip, based on a simple challenge that popped into my head on the train home from work. Using the Sample – Superstore dataset, plot a slopegraph comparing 2013 and 2015 Sales by Sub-Category, and colour lines where Sales in 2015 were higher than 2013.

First, the structure of the slopegraph itself:


Easy stuff. You can go down the dual-axis route to add sizeable dots to the end of the lines, and you could equally just plot a single line and use the Colour card to select the Marker type with dots on the end.

To achieve the desired colour result, I just leveraged the LOOKUP(), FIRST() and LAST() functions:


Take the first sum of sales away from the last sum of sales. Is that value greater than 1 or not?

What does this look like in a table?


Drag [Colour] to Colour, and the job is done:

Screen Shot 2017-01-17 at 21.02.02.png