In our Salesforce organization, we were working on lead management and needed to visualize data statistics, such as lead status and lead source. The built-in charting features of Salesforce were helpful, but we wanted a more dynamic chart that allowed us to apply multiple filters and visualize data.
For this, we used Tableau to create a pie chart displaying lead source statistics. This pie chart displays the lead source statistics, including Website, Phone Enquiry, Referrals, and Events. By visualizing this data, we were able to identify which sources were generating the most leads.
In this blog, you will learn how to create a pie chart in Tableau. Additionally, I will explain how to adjust the pie chart size and change its colors.
Create a Pie Chart in Tableau
In Tableau or other data visualization tools, a pie chart is a circular chart divided into slices, where each slice represents a proportion of the whole dataset. It’s helpful in displaying the breakdown of data and helps to show data as a percentage of a whole in each slice.
In the examples below, we will cover the following two methods to create a pie chart in Tableau.
- Create a Pie Chart with Data Connection in Tableau
- Create a Pie Chart using an External Excel file
Create a Pie Chart with Data Connection in Tableau
To create a pie chart, first, we need to connect Tableau with a data source. In this example, I have connected Tableau with the Salesforce data. Here, I will use the lead data to create the pie chart.
After connecting Tableau with the data source, follow the steps below to create a pie chart.
- In the Tableau, click on the Sheet. I have selected the data source as Salesforce leads, so it will display the lead fields in the Tables section.
In the Marks section on the sheet, select the option Pie.

- Here, I need to visualize the Lead source; for that, I’ll drag and drop the Lead Source field onto the Color card in Marks.

- To add the label of the lead sources and display lead count for each source, add the fields Lead Source and Lead Count to the Label card.

- At this point, the pie chart will show the lead source and count for each angle, but it will overlap the label. Here, we need to increase the chart size.
To increase the chart size, click on the Standard dropdown in the toolbar and select Entire view.

Now, the pie chart will be in the appropriate proportion.

Check out: Tableau Funnel Chart
- To increase or decrease the size of the pie chart, click on the Size card in the Marks. To adjust the size of the pie chart, move the slider left or right.

This way, we can create a pie chart to analyze the data in the table using Tableau.
Check out: Add Charts to Reports in Salesforce
Create a Pie Chart using an External File in Tableau
In some cases, it is not possible to set up a connection with the data source using the server. In my case, I had to create a pie chart using the data from the Salesforce report table.
The Report object in Salesforce does not store actual record data like Leads, Opportunities, etc. As a solution, I exported the Salesforce report and used it in Tableau.
Check out: Stacked Bar Chart in Tableau
Follow the steps below to create a pie chart using an external file in Tableau.
- Open the Tableau app, and navigate to the Connect section. Select the data format of the source file. In this example, I will use an Excel file.

- Upload the file from your system. In this connection, the uploaded file will be there as a Data Source.
- To create a pie chart, click on the Sheet at the bottom of the window.
- To create a pie chart, we need two Measure fields (#) and one Dimension field (abc). Under the Tables section, select the fields with Ctrl+right click.

Check out: Embed Report Chart to Salesforce
- After selecting the fields, go to the Show Me tab and select the pie chart.

Now, the pie chart will display the ratio of field data for the selected fields.
- To add the label, drag the field names to the Label card in the Marks section.

Now, to set the chart in proportion to the labels and make it a bit bigger, click on the Standard dropdown in the toolbar and select Entire View.

In the Entire view, the label and the count will not overlap, and the pie chart will be bigger in size.

This way, we can create a pie chart using an external file in Tableau.
Check out: Create Stacked Bar Charts Dashboard in Salesforce
Adjust Colors in Tableau Pie Chart
The pie chart will display each slice with a unique color. We can also change the slice color in the pie chart.
To change the slice color, click on the Color card and then click on Edit Colors.

Now, select the data item for which you have to change the color. Then, from the available color pallets, select the color and click Apply.

This way, we can modify the colors in the Tableau pie chart.
I hope that by following the above steps, you were able to create a pie chart in Tableau using both live Salesforce data and external Excel files, setting the connection accordingly.
With the additional customization options, such as resizing and color adjustments, you can modify the pie chart UI according to your requirements.
You may also like to read:
I am Bijay Kumar, the founder of SalesforceFAQs.com. Having over 10 years of experience working in salesforce technologies for clients across the world (Canada, Australia, United States, United Kingdom, New Zealand, etc.). I am a certified salesforce administrator and expert with experience in developing salesforce applications and projects. My goal is to make it easy for people to learn and use salesforce technologies by providing simple and easy-to-understand solutions. Check out the complete profile on About us.