The Pareto Chart in Tableau is very useful to Visually check whether our Data is meeting Pareto rule or not (80 – 20 Percent). For example,
- Whether 80 percent of our Profits are coming from 20 percent of Customers or not
- Whether 80 percent of our Sales are coming from 20 percent of Customers or not
- Check whether 80 percent of our Profits are coming from 20 percent of Products or not
- Whether 80 percent of our Sales are coming from 20 percent of Products or not. In all these scenarios, we can use Tableau Pareto Chart.
In this article, we will show you, How to Create Pareto Chart in Tableau with an example. For this we are going to write the Custom SQL Query against the SQL Server Data Source. So, Please visit Connecting Tableau to SQL Server article to understand the configurations. Custom SQL query we are going to use for this report is:
-- Query for Pareto Chart in Tableau SELECT Cust.FirstName + ' '+ Cust.LastName AS [Full Name], Cust.YearlyIncome, Cust.EnglishOccupation, Fact.OrderQuantity, Fact.TotalProductCost, Fact.SalesAmount, Fact.TaxAmt, Fact.OrderDate FROM FactInternetSales AS Fact INNER JOIN DimCustomer AS Cust ON Fact.CustomerKey = Cust.CustomerKey
How to Create Pareto Chart in Tableau
In this Tableau Pareto chart example, we will check Whether 80 percent of our Sales are coming from 20 percent of Customers or not.
First, Drag and Drop the Customers Full Name from Dimension Region to Columns Shelf and Sales Amount Measures region to Rows Shelf as shown below. By default, tableau will generate the Bar Chart as shown below
Please Sort the generated bar chart into Descending Order using the Sales Amount
Next, Please click on the Sales Amount Measure from Row Shelf and select the Quick Table Calculation option and then select the Running Total to calculate the Running Total shown below
From the below screenshot you can observe that, We have successfully created the Pareto Chart in Tableau. However, we are unable to check whether 80 percent of our Sales are coming from 20 percent of customers or not?
In order to achieve the same, we have to change the Sales Amount Axis from Running Sum to Percentage of Total.
To do this, Please click on the down arrow beside the Sales Amount measure and select the Edit table Calculation option as shown below
Once you select the Edit table Calculation option, following window will be opened.
- Please change the Running along option from Table Across to Customer Full Name field. This will calculate the running total based on customer name rather than table
- Please check mark the Perform Secondary Calculation on the result option and select the secondary calculation Type as Percent of Total
- Don’t forget to change the Summarize the values from option from Table Across to Customer Full Name field as shown below
Now we can identify the 80 percent of sales but again, we have to compare with 20 percent of our customers. In order to achieve the same, we have to change the axis names from customer name to percentage. To do this, Let us create one calculated filed.
Right click on the empty space present in Measures Region. Now, Please select the Create Calculated Field option from the Context menu as shown below
Once you select the Create Calculated Field option, a new window will be opened to write the Custom Expression.
For this tableau Pareto chart example, we need the customers percentage so please add the following expression
Now, Please Drag and drop the newly created calculated field (Customers Percentage) from Measures region to Columns Shelf. Next, Remove the existing Customer names from Columns Shelf and place it in the Level of Details filed present in Marks Shelf as shown below
Next, Please change the Marks type from Automatic to Line type. To do this, Please expand the drop-down list and change the Automatic to Line as shown below
Let us format the Axis labels to the percentage. Right-click on the Customers name Axis and select the Format option from the Context menu
We have done all the work to check whether our 80 percent of sales are coming from 20 percent of our customers or not. From the below screenshot you can observe that it’s not 20 percent but 28 percent of our customers
Add Reference Lines to Pareto Chart in Tableau
If you want to add reference Line to Tableau Pareto chart then follow this section.
In this, we are adding reference lines for 80 percent, Right-click on the Sales Amount Axis and select the Add Reference Line option and change the value to constant 0.8 (which is technically 80 percent)
If you want to add reference Line for the 20 percent, Right click on the Customers name Axis. And select the Add Reference Line option and change the value to constant 0.2 (which is technically 20 percent)
From the below screenshot you can observe that We successfully created our Tableau Pareto Chart
Thank You for Visiting Our Blog