How To: Sorting Stacked Bars by Multiple Dimensions in Tableau

For Makeover Monday, I wanted to tell the story of how Facebook is making an effort to make clean and renewable power its primary source of energy.  I wanted to be able to sort the stacked bars by energy usage percentage by year.  Here's how it's done:

1. Build your stacked bar chart in Tableau.

2. Create a combined field using the dimensions you want to sort by.  In this case, I want to sort by energy source by year.

3. Drag the combined field to the detail and sort by the measure.  Here I am sorting by the Amount.

4. Finally, drag the dimension that you are sorting by to the detail. I am using Energy Source in this example.

Now you have a stacked bar that is sorted by two dimensions.  In my example, it is sorted by energy source and date. This allows for some nice interactivity that allows you to show trends and magnitude simultaneously.  In my example, I am using it to show the rank of the energy sources while also showing the magnitude against other energy sources.

Please comment below with any questions or download the worbook to see how it's done.

Makeover Monday: Facebook's Footprint

This week's Makeover Monday focused on Facebook's sustainability page. I wanted to tell the story of how Facebook is making an effort to make clean and renewable energy its top source of power.  First, I built a bump chart to look at the change in rank over time.

This view doesn't look bad, but it doesn't really show the magnitude of the energy usage.  This is something I realized after seeing a post from Steve Wexler pertaining to the visualization I had done previously on car color evolution.

So using Steve's post as inspiration, I decided to try to build something that would show the magnitude instead.  I came up with this view.

Click for interactive version

Now we can see the total usage over the time period as well as the trends in energy usage.  Using this view, we are able to show how clean and renewable has become the number one energy source, but we are also able to show the magnitude against the other energy sources.

I really liked this view, but I wanted to create a stacked bar version as well.  I was able to sort the energy sources by year within the stacked bar, and I came up with my final version.

Click for interactive version

I'm pretty happy with this view as you are able to see the total usage, the trends, and the magnitude together.

How To: Density Maps Using Hexbins in Tableau

After my previous post, I continued to work with some alternative methods in Tableau.  I decided to look at using hexbins instead.  This is a bit more complex than rounding the lat/long but not much.  Let's see how it's done.

1. Create a parameter called Ratio.  This will let you control the binning.  The higher the ratio the more bins in the view.

2. Create the hexbins for Latitude and Longitude.

3. Drag Hexlong and Hexlat to Columns and Rows Respectively.  Set your ratio to the binning level that you prefer.  In this case I've used 2.5.  Hide the headers as well.

4. Pull the worksheet into the dashboard and size appropriately.  I used 1184 by 660 in this view.

That's all there is to it. Feel free to download the workbook and see how it is done or comment below for questions.

How To: Density Maps in Tableau

I saw an article on density maps in Excel written by John Nelson, and I really liked the effect of showing the density of tornados without representing entire states.  Looking at John's tutorial, all you really need to do is round the latitude and longitude.  This is dead simple to do in Tableau.  Let's see how it's done.

1. Create calculated fields for the rounded latitude and longitude.

2. Drag the rounded latitude and longitude on to the rows and columns shelves.  Make sure that both are continuous dimensions. Set the mark to square and the size in the middle.

3. Drag the dimension you need to the color shelf and turn off gridlines.  Hide both headers as well.

4. Finally, bring the worksheet into the dashboard and size appropriately.  I used 1050 by 550 to get the sizing I liked.

That's it!  Feel free to comment with questions or download the workbook.

Darkest Days: The Five Deadliest Tornado Outbreaks in the US 1950-2015

For this month's RevizProject, we decided we wanted to find visualization that were really famous on Tableau Public, update the data set, and build our own version to tell a different story.  I've always been fascinated with Anya Ahearn's Iron Viz winner, so I asked for her blessing to use it for inspiration.  Anya did this amazing viz in 20 minutes on stage in front of spectators to take home the Iron Viz championship.  This is really impressive, and I know from personal experience how hard it is to compete in the Iron Viz.

Anya did a tremendous job of showing how Dixie Alley is actually more deadly than Tornado Alley.  When I looked at the data set, I thought back to April of 2011 and the horrific tornadoes that hit Alabama.  I started to look at the data, and that date, April 27th, 2011, was actually the most deadly tornado outbreak since 1950.  That was a very powerful story to me because I remember the news coverage vividly, but I wanted to build something that would help evoke those memories but also tell the story of the other four deadliest outbreaks.

To do this, I wanted to build something that was a visual story, but I didn't necessarily want to use storypoints.  I decided to build a parameter that lets you cycle through the story.  The paths of the tornadoes are shown on the map, and the states that were affected are shaded.  I really liked this view against a minimalist map because it puts the focus on the data while maintaining the map for geographic reference.

I also wanted to add functionality where clicking on the tornado path allows the user to see the actual damage of the tornado.

I'm really excited to see which direction Peter Gilks takes for his first Reviz, and I'm sure Alex Duke will have an amazing design as well.

Check out the interactive version!