Pie Chart in Tableau is useful to display the Sales by region, Countrywide customers, Sales by Country, etc. Pie Charts are also helpful in the dashboard design. We can use the Tableau pie chart to display Country wise sales, and then use the Action filters to drill further down.
In this article, we show how to Create a Pie Chart in Tableau with an example. For this, we are going to use the Data Source we created in our previous article. So, Please visit Data Labels in Tableau Reports article to understand the Data Source.
If you want the Custom SQL Query Only for this report, then use the following query as your SQL Server Data Source
SELECT Geo.[EnglishCountryRegionName] AS [Country] ,Geo.[StateProvinceName] AS [State] ,SUM(Cust.YearlyIncome) AS YearlyIncome ,SUM(Fact.SalesAmount)AS SalesAmount FROM DimCustomer AS Cust INNER JOIN FactInternetSales AS Fact ON Cust.CustomerKey = Fact.CustomerKey INNER JOIN [DimGeography] AS Geo ON Cust.GeographyKey = Geo.GeographyKey GROUP BY Geo.[EnglishCountryRegionName],Geo.[StateProvinceName]
Create a Pie Chart in Tableau Approach 1
First, Drag and Drop the Sales Amount from Measures Region to Columns Card. Since it is a Measure value, the Sales Amount will aggregate to Sum(default).
Next, Drag and Drop the English Country Region Name from Dimension Region to Rows Card. Once you drag them, the following screenshot will be displayed.
Once you select the Pie Chart from Show Me window, Pie Chart will display with default colors
Please use the Size option in Marks Card to expand or Shirk the Pie chart in Tableau
If you observe the above screenshot, the Tableau Pie chart is providing the perfect results. However, we are unable to identify the difference between Sales in France and Sales in Germany. To resolve these situations, We have to display the Data Labels.
Add Data labels to Pie Chart
To add data labels to Tableau Pie chart, Please drag and Drop the data Label values from Dimension or Measures Pane to Label option in Marks Card.
In this example, We want to display the Sales Amount as Data labels so, Drag and Drop the Sales Amount from Measures region to Labels option
Tableau allows us to add Multiple Measure values as Data Labels. It can be handy when you want to compare the Total Sales against the Profits by Region. To do this, use the above technique to place the Yearly Income
Format Pie Chart in Tableau
One of the most common questions raised by any developer is formatting Tableau Pie Chart. Because the Default colors or Default Pie Chart pallet may or may not be attractive to the end-user.
To do this, Please select the Edit Colors.. option from the context menu as shown below
Once you choose the Edit Colors.. option, a new window called Edit Colors will be opened to select the Color Palette for English Country region name. For demonstration purpose, we are choosing the Color Blind 10
Click the Apply button and then click OK to finish it
Create a Pie Chart in Tableau Approach 2
This method is very easy and straightforward. First, Please select the Pie option from the drop-down list present in Marks Card
Next, Drag and Drop the Sales from Measures Region to Filed region, as shown below.
Next, Drag and Drop the English Country Region Name from Dimension Region to Color option in Marks Card.
Once you drag them, the following screenshot will be displayed. Hope you understood, How easy, it is to design or create a Pie Chart in Tableau
Remember, Pie chart allows us to add both Dimensions and Measures as the Data Labels. To demonstrate this, We just placed the Sales Amount Measure and English Country Name on the labels Option present in Marks card
NOTE: It is always advisable to use Tableau Pie charts on High-level Data. For instance, If you use the same Pie Chart for State-wise sales rather than Country-wise, you will end up with the following screenshot. If you see carefully], we can’t even identify a few regions.