Reference lines in QuickSight
By: Dr Sophie Acker
Tags: Quicksight, Dataviz, Dashboard

QuickSight Tips & Co

Reference lines in QuickSight

The other day I was working on a dashboard in AWS QuickSight, creating a bar chart. As I opened the setting tab of my visual, I saw a new section: “reference line”.

I got really excited because I use to love reference lines on Tableau, so I gave it a go. You will find here a step by step process, as well as some thoughts on the limitations of the feature at this stage.

I will be using the superstore dataset for all examples in this article.

What is a reference line?

A reference line is a user-defined vertical or horizontal line in a graph. It is used to easily compare data points to that reference.

For example, you could look at quarter to date sales, and have a reference line showing the quarterly target. You will be able to assess quickly whether you have passed the target yet or not.

Another example could be, if you look at revenue across teams, to set a reference line as the average, so you would easily know which team is above/below average.

The data used for the reference line can be a fixed number (eg: a target), or a calculated one (eg average, median, max, min…).

How to create a reference line in AWS QuickSight?

Reference lines are available for 3 visual types in QuickSight:

Line charts

Bar charts

Combo charts

Once you have created your chart, click on the “Format Visual” icon on the top right corner of your chart, this will open the “Format Visual” pane on the left hand side of the screen.

QuickSight screenshot from the author.

QuickSight screenshot from the author.

The “Format Visual” pane allows you to format title, X and Y axis and data labels. And now…to create reference lines!

Click on the reference line menu and then on “add new line” to open to create a line.

You are then prompted to chose the line settings.

The first section covers the data you want to display: constant line or calculated line.

For constant you will be requested to enter a value

For calculated you will be requested to provide on which column (aka field) and with which level of aggregation and which calculation you want to compute (average, min, max or percentile).

Note you can add a calculated line based on a field that is not in your chart!

The rest of the menu covers the line style (full, dotted or dashed, and color); and the label type, position, value format and font size.

In the end, I ended up with such a bar chart. I have also formatted the axis and data labels along the way.

QuickSight screenshot from the author.

First impressions

First thing you will probably notice on the chart above, is that the automated positioning isn’t great; the text and value are too close from the x axis. Not a huge deal but readability could be better.

One way to solve for this is to use a vertical layout for this graph. I don’t like to have to change my viz choice for reasons like that but hey — reads better. So up to you to decide what matters most in your use case.

QuickSight screenshot from the author.

Then I tried to add a Parameter on the tab, to see if the average would recompute automatically. And it does! that’s pretty cool.

QuickSight screenshot from the author.

I think this feature is a great add to AWS QuickSight. I used to be a big fan of reference lines in Tableau, so I’m glad to see the QuickSight team ramping up!

Of course I would love to be able to color above or below the line, or create bands like in Tableau, but I am sure one day I will discover it is live in QuickSight. It is always full of surprises.

Have fun using reference lines.