Search
  • James Goodall

Tableau Bitesize: Progress To Target - Donut Chart

This post will go through the process of creating a donut chart in Tableau



Actually – to call it a donut chart is a little misleading – what we’re actually doing it creating a pie chart with a circle over the top of it, but hey, if it looks like a donut, quacks like a donut….


This, together with the other blog posts relating to the ‘Progress to Target’ viz will use the ‘progress_dummy_data.csv’ file attached below:


progress_dummy_data
.csv
Download CSV • 17KB

This file contains dummy data related to 5 teams – it has just 3 columns: ‘ID’, ‘Team Name’, and ‘Target Met’ and is therefore recording which teams have met their particular (generic) target



As with the other blog posts, start off by creating a parameter from the ‘Team Name’ field:


Next, create a calculated field called ‘Team Filter’ as follows:



[Team Name] = [Team Name Parameter]


Then drag this to the Filters card and select ‘True’



You can then choose a team from the list of parameters – in this example I will be using ‘team_3’


To start off with the donut chart, we’ll need to create a few more calculated fields


0



MIN(0)


‘Total Met Target’:



SUM(IIF([Met Target],1,0))


This one simply records a ‘1’ value whenever the team has a TRUE value for the ‘Met Target’ field which we can then use to calculate the %


Total Not Met Target


SUM(IIF([Met Target],0,1))


This will simply record the inverse of the previous calculation


% Met Target



[Total Met Target] / COUNT([progress_dummy_data.csv])


OK and we’re ready to go

Start off by dragging the ‘0’ field twice onto the ‘Rows’ shelf and set it as ‘Dual Axis’


Synchronise and hide the headers, then remove all lines and borders


Next, change the ‘bottom’ layer (the ‘0’ field on the left of the dual axis) to a pie chat and the top / right one to a circle



On the Pie Chart mark, drag ‘Measure Names’ to Colour and ‘Measure Values’ to Size then leave only the fields AGG(Total Met Target) and AGG(Total Not Met Target) (ensuring that AGG(Total Met Target) is on the top



On the Circle mark, change the colour to white and reduce the size slightly



Change the colours on the pie chart to those of your choosing (I usually go for a washed out grey for the count field then a bolder colour for the other, as in the above image)


On the Circle mark, drag the ‘% Target Met’ field onto label and format to your choosing



And that’s all there is to it! I hope you found this useful but if you have any questions – please feel free to leave a comment below!


Because of the nature of the chart – it’s recommended that this would only be used in scenarios where 100% is the maximum value you would expect to see


The workbook on Tableau Public below contains all of the chart types used in the ‘Progress to Target’ series, including this one




98 views0 comments