Build a Stacked Donut Chart in Tableau

Have you ever wanted to stack 4 pie charts on top of each other to build a visual? Let’s have some fun building out a stacked donut chart or a “TrailBlazer” chart as I call it due to its likeness to a particular NBA team’s logo.

Stacked Donut Chart Thumb

Portland Trailblazers anyone?

Stacked Donut vs Trailblazer

In order to build out this chart I used an innovative technique shared by Simon Runc on the Tableau forums. Feel free to check out that post here.

Using Tableau’s Sample Superstore Data, Simon came up with an innovative use of the INDEX() function and the Size functionality to create three different pie charts that each show a respective percentage of a measure (in this case Sales) to the Total amount of the measure.

For example, the chart highlights in red the percentage of Consumer Sales as a percentage of all segment sales (i.e., Consumer + Corporate + Home Office). The grey portions represent all other sales, other than the segment of interest.

The trick to this approach is using the Index function to create a pie chart per segment. For example Consumer is assigned a value of 1, Corporate a value of 2 and Home Office is assigned 3. When the INDEX() value is placed on size, the three different charts are assigned sizes where one is slightly larger than the next.

Stacked Donut Raw 2

With a little division and axis customization, the three segments are placed on top of each other to provide a stacked pie chart effect. The hole is courtesy of the standard methodology for creating a donut chart which involves a dual axis.

It makes much more sense when you see it in action so make sure to watch the video!

Here is an example of the raw stacked donut chart before the “TrailBlazer” formatting.

Stacked Donut Raw

Feel free to interact with the viz and download the workbook on Tableau public:

As always, If you find this type of instruction valuable make sure to subscribe to my Youtube channel.

Definitely check out other posts of interest for building donut charts in Tableau:

All views and opinions are solely my own and do NOT necessarily reflect those my employer.

Create a Tableau Waffle Chart Fast and Easy

In this Tableau tutorial I am serving up some delectable waffles in the form of a fast and easy waffle chart. Watch the video to learn the easiest and quickest way to create a waffle chart in Tableau.

If you’re familiar with the Southeast United States then you know that we love The Waffle House down here. As an homage, I made a simple dashboard in the iconic Waffle House signage style.

A waffle chart depends upon a data connection to the data you wish to visualize and a data connection to the waffle chart template. Once you have these two items setup, you simply create a calculated field that marks the fill percentage in your waffle.

Help yourself to some waffles below:

As always, If you find this type of instruction valuable make sure to subscribe to my Youtube channel.

All views and opinions are solely my own and do NOT necessarily reflect those my employer.

The Ultimate Tableau Slope Graph Video

In this video I tackle the subject of slope graphs also known as slope charts. I had some fun putting together this dashboard that illustrates the changes in wins for NBA teams during the 2016-2017 and 2017-2018 seasons. From the video you’ll discover that Chicago, Atlanta and Memphis are on a Hindenburg-like trajectory, while trusting the process in Philadelphia led to huge season gains in overall wins.

Here’s what you will learn from this video:

  • How to create a parameter that enables a user to select which win statistic measure to visualize;
  • How to use Table calculations like, LOOKUP(), FIRST() and LAST() to calculate period over period change;
  • How the impact of Mike Conley’s injury affected the Memphis Grizzlies last season;

Click the pic to interact with the Tableau Public visualization, also download the workbook and data to dissect as needed.

For your convenience the calculated fields that I used to create the measures are listed here. Note that [Selected Measure] is a parameter that you need to create that lists all of the measures.

Calc Select Measure
CASE [Selected Measure]
WHEN “Home Losses” Then [Home Losses]
WHEN “Home Wins” Then [Home Wins]
WHEN “Overall Losses” Then [Overall Losses]
WHEN “Overall Wins” Then [Overall Wins]
WHEN “Road Losses” Then [Road Losses]
WHEN “Road Wins” Then [Road Wins]
WHEN “vs East Conf Losses” Then [vs East Conf Losses]
WHEN “vs East Conf Wins” Then [vs East Conf Wins]
WHEN “vs West Conf Losses” Then [vs West Conf Losses]
WHEN “vs West Conf Wins” Then [vs West Conf Wins]

END
Better or Worse
IF [Selected Measure] = “Home Wins” OR
[Selected Measure] = “Overall Wins” OR
[Selected Measure] = “Road Wins” OR
[Selected Measure] = “vs East Conf Wins” OR
[Selected Measure] = “vs West Conf Wins”
THEN
//WIN MEASURES: Negative delta treated as “WORSE”, Positive delta treated as “BETTER”
(IF [Delta] < 0 THEN “WORSE” ELSEIF [Delta] = 0 THEN “SAME” ELSE “BETTER” END)
ELSE
//LOSS MEASURES: Positive delta treated as “WORSE” (more losses are worse), Negative delta treated as “BETTER”
(IF [Delta] > 0 THEN “WORSE” ELSEIF [Delta] = 0 THEN “SAME” ELSE “BETTER” END)
END
Delta
LOOKUP(SUM([Calc Select Measure]),LAST()) – LOOKUP(SUM([Calc Select Measure]),FIRST())
Delta ABS Value
ABS(LOOKUP(SUM([Calc Select Measure]),LAST()) – LOOKUP(SUM([Calc Select Measure]),FIRST()))
ToolTip
<Team> Trend: <AGG(Better or Worse)> by <AGG(Delta ABS Value)>
During the <Season> Season, the <Team> had <SUM(Calc Select Measure)> <Parameters.Selected Measure>.

I have to give thanks to Ben Jones at the Data Remixed blog for the inspiration!

As always, If you find this type of instruction valuable make sure to subscribe to my Youtube channel.

Filter Top N Values with a Slicer in Power BI

In this video you will learn how to filter the top N values shown in your bar chart visualization using a slicer.

  1. This technique uses one measure that generates a number 1-10, that will be applied to a slicer.
  2. Another measure will basically rank all of the values associated with your data bars and only return the values that are less than or equal to the number you select in the slicer.

The comments that I apply to the DAX function should help make it easy to understand. I have to give a shoutout to GilbertQ from the PowerBI community for coming up with the  initial approach which I tweaked for the video.

As always, If you find this type of instruction valuable make sure to subscribe to my Youtube channel!

Row and Column Highlighting in Tableau

In this post you’ll learn how to highlight values in your Tableau table using set actions. The dashboard in this video displays the number of total points scored by NBA teams by position in the 2017-2018 season. I will give you step by step instructions on how to implement row and column highlighting on this dataset downloaded from basketballreference.com.

I’ve only made a few minor tweaks but this technique was developed by Tableau Zen Master Matt Chambers. You can check out his blog at sirvizalot.com and follow him at Big shout out to Matt for sharing this technique with the Tableau community!

You can interact with my visualization on Tableau Public:

If you find this type of instruction valuable make sure to subscribe to my Youtube channel!

Make Flashy Maps in Tableau with Mapbox

The default maps in Tableau are just fine but sometimes you need to kick up the flamboyancy factor in your visuals. Integrating maps from Mapbox with Tableau is the perfect way to add some Liberace flash to your development game.

Mapbox is an open source mapping platform for custom designed maps.  By creating an account with Mapbox, you can either design your own maps on the platform or use their preset maps, which are all more impressive than the out of the box option in Tableau.

All you need to do is enter your generated API token (provided by Mapbox) into Tableau’s Map Services interface and you’ll have access to some pretty impressive mapping options.

If you’re interested in Business Intelligence & Tableau subscribe to my  Youtube channel.

 

 

Use the Power BI Switch Function to Group By Date Ranges

In this latest video, I’ll explain how to use a handy DAX function in Power BI in order to group dates together for reporting. We’ll examine a dashboard that contains fields corresponding to purchase item, purchase date and purchase cost. We’ll then create a calculated column and use the SWITCH function in Power BI to perform our date grouping on the purchase date.

Watch the video to learn how to group dates into the following aging buckets, which can be customized to fit your specific need.

  • 0-15 Days
  • 16-30 Days
  • 31-59 Days
  • 60+ Days

If you are familiar with SQL, then you’ll recognize that the SWITCH function is very similar to the CASE statement; which is SQL’s way of handling IF/THEN logic.

Even though we’re creating a calculated column within Power BI itself, best practice is to push calculated fields to the source when possible. The closer calculated fields are to the underlying source data, the better the performance of the dashboard.