Today, in this blog I will take you through the steps on how to build a donut chart in Tableau. A donut chart is similar to a pie chart but it has a central area empty giving a feel of two concentric circles or rings.
This chart is best used to represent:
- % split between different values within a dimension/KPI
- % achieved with respect to total.
Without any further delay, let’s start building our donut chart in Tableau. For this example, we will be referring to the Sample Superstore dataset which comes in handy, and build a donut chart that represents the percentage split of quantity among various categories.
Step 1:
First, in the marks card, change the mark type to pie type because we will first try and make a simple pie chart. Now, drag the Category from the data pane to the Colors and Quantity to Angle respectively. Use SUM() as an aggregation for Quantity.
As we can see, we have a pie chart and the angles in the pie chart represent the distribution of quantity among the categories. Now if we look carefully, a doughnut chart can be created using this pie chart if we remove the smaller middle section from this.
Step 2:
For proceeding, we will create a Calculated field which can be named as ‘number of records’ and in the formula, we will just write ‘1’
Step 3:
After creating this calculated field, drag the same to the Row shelf and duplicate the measure. Use AVG() as the aggregation for both the measure.
Step 4:
For the next step, we will increase the size of the Upper pie chart and remove the Color from the below pie chart. You can do this by clicking on each of the respective columns in the row shelf to see their respective marks card.
Step 5:
Now we will merge both the measures by right-clicking on the ‘number of records’ and selecting the Dual-axis. Once you do this, you shall be able to see both the pie charts merged one above the other.
Step 6:
Now, change the color of the inner pie chart to match the color of the background i.e. white in this case. You can do this by clicking on the respective mark card which represents the inner circle and then editing the color to white.
Step 7:
Secondly, we want each sector should give the proportions of the total quantities. So we will drag SUM(Quantity) to the selected measure card that shows results on the bigger pie chart. For Percent of the total, we will add a Quick action of “percent of the total” to SUM(Quantity).
Check out other useful charts below:
- How to create a rounded bar chart in Tableau
- Edit Table calculation in Tableau
- Switch Between YoY and MoM using Parameter Selection
- Add Map Layers in Tableau
- Create and synchronize dual axis in Tableau
Follow us on Twitter, Facebook, Linkedin, and Tableau Public to stay updated with our latest blog and what’s new in Tableau.