Tablueprint 3: Super Bowl Margins of Victory

tablueprint-featureTablueprints is a series where I share how to make my Tableau data visualizations. If you would like updates on future posts, be sure to subscribe. I will only email when I have something new to share and I will not share your email with anyone.

In this installment, I share:

– How to make Tableau dumbbell charts / DNA charts
– How to use parameters to change the sort order
– How to use parameters to toggle normalization on and off
– How to use dashboard actions to highlight a view
– How to provide instructions using tooltips

For this Tablueprint, we will be rebuilding Super Bowl Margins of Victory.

[Click image to view interactive version]

Super Bowl Margins of Victory Tablueprint

 

How to make Tableau dumbbell charts / DNA charts

Dumbbell charts, or DNA charts, were the primary visual for this workbook, so we will start there. I find this chart type to be an engaging and effective choice for illustrating the difference between two points. In order to create this view, you need to have the dimension members that you will use to connect the dots on separate rows. In my example, the dimension is the league, and the dimension members are AFC and NFC.

To make a dumbbell chart in Tableau, start by creating a dot plot. For mine, I started with the Game ID on the Columns Shelf and score of each game on the Rows Shelf. After putting these fields on the view, the default chart type will be a vertical bar chart. To transform this to a dot plot, simply change the mark type to Circle.

Tableau Dot Plot

Next, change the level of detail of the view by dragging the dimension that you want to compare to the Color Marks Card. For a dumbbell chart, the dimension should only include two dimension members to compare. If you have more than that, you can always filter the view to two dimension members. Here’s how my view looks after dragging League to the Color Marks Card and applying my desired colors.

Tableau Dot Plot with Level of Detail

To create the line that connects the dots, drag the Score measure to the Rows Shelf so that it appears twice. When there are two measures on the Rows Shelf, each will have its own set of Marks Cards which can be edited independently. Change the mark type for the second row to Line, and drag the League dimension to the Path Marks Card (it was previously on the Color Marks Card).

Tableau Dot Plot and Line Graph

Next, click on the second measure on the Rows Shelf and choose “Dual Axis”.

Tableau Dual Axis Graph

Lastly, ensure the axes line up by right-clicking on the right axis and choosing “Synchronize Axis”. Here’s how my final dumbbell chart looks after moving the marks for the right axis to the back, hiding the right axis, and cleaning up the formatting.

Tableau Super Bowl Margins of Victory Dumbbell Chart

For more on this visualization type, see How to Make Dumbbell Charts in Tableau.

 

How to use Tableau parameters to change the sort order

After originally posting this visualization to Tableau Public, I got a great tip from David Krupp, Lead Tableau Specialist at Gallup, about sorting the view by margin of victory instead of chronologically. This is typically a best practice, especially with bar charts, but one I did not prioritize because I was in favor of the chronological view. After hearing the feedback, I thought why not use Tableau parameters to do both?

To do this, start by setting up a string parameter with your sort options.

Tableau String Parameter

After setting up a parameter, you have to give Tableau instructions for how to use that parameter. In my case, if ‘Chronological’ is selected in my Sort parameter, I want my dumbbell chart to be sorted by Game ID. If ‘Margin of Victory’ is selected, I want my dumbbell chart to be sorted by the Margin of Victory measure.

Tableau Sort Order Calculated Field

Note that Margin of Victory was already a calculated field that subtracts the losing score from the winning score. I also added a negative sign before Margin of Victory because Game ID and Margin of Victory have conflicting sort directions (i.e. Game ID should be ascending; Margin of Victory should be descending). This is a clever way to get the view to sort correctly when they’re both set to sort in ascending order.

After you’ve set up the parameter and calculated field, you’re ready to set the Sort for the dumbbell chart. To do so, click Game ID on the Columns Shelf and choose “Sort”. This will open a dialog box where you can set the view to sort based on the newly created Sort Order calculated field.

Tableau Sort Order

Don’t forget to show the parameter control for the Sort parameter which will allow your end users to toggle between the two options.

For more on bar chart best practices, see 3 Ways to Make Beautiful Bar Charts in Tableau.

 

How to use Tableau parameters to toggle normalization on and off

When I originally posted this workbook to Tableau Public, I had each of the losing scores begin at zero. This aligned all of the margins of victory so you could quickly compare them (like a bar chart). My friend and fellow Tableau Zen Master, Chris Love, said “so I read this as the losing teams always score the same….”. This led to some light-hearted debate on Twitter, and alas, I admit I am still on a quest to create my very first perfect data visualization. I figured I could easily help my end users avoid confusion by providing the option to turn the normalization on and off. To accomplish this, I will use a similar parameter technique from the previous section.

To begin, set up a Boolean parameter; True will represent the normalization being turned on, while False will represent the normalization being turned off.

Tableau Boolean Parameter

Just as before, I now need to give Tableau instructions on how to handle each of these two choices.

Tableau Margin of Victory Dumbbell Calculation

This formula is slightly more complex than the sort order, but is just saying that if the normalization is off, simply use the Score measure as we did when creating the first dumbbell chart above. If normalization is on, the losing score is hard-coded at 0.

This is a critical calculated field because it will replace the original score measure for both the circles and lines in the view.

After recreating the dumbbell chart with this newly created calculated field and showing the parameter control, the end user can toggle the normalization on and off!

For more on my history of creating imperfect data visualization, see Data Visualization: The Stolen Art.

 

How to use dashboard actions to highlight a view

One of the interactive features of this data visualization is that the end user can click on the color legend to highlight the scores for each league. To accomplish this, I started by setting up a controller sheet with the color legend and two choices.

Tableau League Controller Sheet

I then added this sheet to the dashboard with the dumbbell chart and set up a highlight dashboard action. To set up a highlight dashboard action in Tableau, navigate to Dashboard > Actions… in the top navigation of a dashboard. I then added a highlight dashboard action and set it up like this:

Tableau Color Legend Highlight Dashboard Action

For more on Tableau dashboard actions, see Practical Tableau: 3 Creative Ways to Use Dashboard Actions.

 

How to provide instructions using Tableau tooltips

Lastly, I will share a technique that I often use to provide instructions in my Tableau dashboards. This approach involves setting up a ‘controller sheet’ like we did in the last section, but this time I will place a calculated field for “HOW TO READ” on the Text Marks Card. There are a couple of ways to get this result, but I like to create a calculated field that includes the text for my instructions.

Tableau Instructions Calculated Field

After creating the calculated field, drag it to the Text Marks Card.

Tableau How to Read Controller Sheet

Now if I click on the Tooltip Marks Card, I can write the instructions or other information that I want to provide.

Tableau Instructions Tooltip

When this worksheet is placed on the view, hovering over “HOW TO READ” will reveal the tooltip that contains the instructions!

Thanks for reading,
– Ryan