Skip to main content

Creating Donut and Sunburst chart in Tableau

 Are you bored of using a basic Pie chart in your visualization? Then this blog is for you. In today's blog, we will discuss step-by-step procedures to create a donut chart. Along with the donut chart, there is a much more so stick around. Let's start with a basic donut chart which proves to be the best alternative to the pie chart. A donut chart is a type of Pie chart where the center is carved out so that you display text in the carved-out space. 

Pro Tip-: Donut chart can be used to display your KPIs and you can use it to display ratios and percentages. But if you are trying to visualize more than 5 categories try to avoid the donut chart because it will hamper the quality of visualization. The stakeholders expect to see clear visualization where the graphs tell their story by themselves.

(For more pro tips do follow our blog )

So let's get started!!!! To create the donut chart we are using the sample superstore data and will highlight all the steps from scratch. 

To start off we are considering the orders table and create a calculated field (reference) that is 0. Take the calculated field in rows and in the marks pane select the pie. You can increase/decrease the size of the pie accordingly.


After getting the pie copy the calculated and paste it in the rows so that you will get two pies. Now you can get the essence of where this visualization is heading to and you can guess the next steps if you are aware of Tableau. We are looking to use the dual-axis with the two pies.





In the marks pane, you can see you have two calculated fields you need to select the second calculated field, and in the color, tab select white so that you get the carved out space. After that in the first calculated field add the region to colors. 

Let's consider the case where you have several levels of hierarchies and you need to show all of them in a single chart. In that case, you can't rely on a donut or a pie chart. You need to switch focus on the Sunburst chart. It is one of the best visualizations when it comes to hierarchical data. We will be creating it in Tableau with the sample superstore data.

We will take the categories and put them in the colors and select the pie in the marks pane. It will give you the basic pie chart and as with most visualizations, in Tableau, we are looking forward to doing a dual-axis. For that, we need two pie charts. In columns, we need to create SUM(0) and copy that. In the angle tab, you need to put the sales.




After getting the two pie charts in the marks pane select the SUM(0)_2 and add the subcategories in the color. You can see the reason because you get different categories in one of the pie charts and subcategories in another and eventually we will use dual-axis to merge them.



We are getting close to the final result and you can adjust the size of both pie charts accordingly. Now select the first SUM(0) in the marks pane and sort the subcategories with respect to the sales. The most important thing is we are sorting the subcategories in terms of the field and in descending order.


At last, we will select the right colors for the sunburst chart for that you need to edit the colors and a toggle will open where you need to select all the subcategories that come under a particular category. Like in our case we got 4 subcategories under the furniture category. We are selecting all the subcategories under furniture and assigning them blue colors. Similarly, you can do it for other categories. And after assigning the right colors you will get the sunburst chart.






Doesn't it look beautiful and provide more details when compared to donut charts and pie charts? You can add more details to this chart. The donut chart is a sunburst chart with no hierarchies in it. You can achieve the same visualization in Power BI too. Such a level of detail can lift up the standards of your dashboard and makes the task of the stakeholders much easier.



Thanks for Reading  Let's connect on  LinkedIn.



Comments

Popular posts from this blog

Ultimate Beginners Guide to DAX Studio

There are zillions of external tools available with Power BI but DAX Studio is one of the most commonly used tools to work with DAX queries. It is a perfect tool to optimize the DAX and the data model. In this blog let's shed some light on the basic functionalities that can take your report to the next level. ARE YOU READY?  To start you will need the latest version of the DAX Studio. You can download it from their website . Don't worry you don't have to pay for the license. Fortunately, DAX Studio is a free tool As a BI Developer, I am using DAX Studio regularly. Based on my experience I use it for several purposes but in this blog, I will highlight the most common ones. Extracting a dump of all the measures used in your PBIX. Why do we need to do this? It can be used for documentation purposes also sometimes we try to reuse the DAX and such a dump comes in handy in this scenario. How to achieve it? Open the DAX Studio it is located under the external tools once you open t

Identify and Delete Unused Columns & Measures

Heavy dashboards and a bad data model is a nightmare for every BI Developer. Heavy dashboards can be slow due to multiple reasons. It is always advised to stick with best practices. Are you still figuring out about those best practices then you should definitely have a quick read on Best Practice Analyser ( link ). One of the most common issues with slow dashboards is unused columns and unused measures.  It is very normal to load some extra columns and create some test measures in your dashboard but as a part of cleanup process those unused columns and unused measures should be removed. Why we are removing them? Because if you keep them then ultimately it will increase the size of your data model which is not a good practice.  How to identify the culprits (unused columns and unused measures)? In today's blog we will provide you with 2 most common external tools which will help you in identifying the culprits. More external tools😒. Who's going to pay for this? To your surprise

Best Practice Analyser (BPA) Guide

Do you want to save tons of efforts to check if your data model and PBIX file follows the standard best practices and norms? Then this blog is for you. If you are a follower of our channel we already deep dive into the importance of the DAX Studio as an external tool. If you are a beginner I would highly recommend to visit this blog . In today's blog we will check how Tabular Editor can help to optimize the data model.  Best Practice Analyser allows to define or import best practices. It will make sure that we do not violate the best practices while developing a dashboard. Isn't it exciting!! Before we start make sure you already have Tabular Editor version 2.24.1 installed on your system. To install it do visit this link and select the link for windows installer. Once Tabular Editor is installed it will reflect in your PBIX file under external tool. Also, we need to define the standard rules. To do so in your advanced scripting or C# script copy this and save it via Ctrl+S. An