We hear it all the time: 20% of our customers are responsible for 80% of our revenue. Known as the Pareto principle or the 80/20 rule it can be a useful rule-of-thumb, but is it true for your business? Let’s see it in Tableau.
To do this we’ll have to be familiar with table calculations. If you haven’t already, I highly recommend checking out the video tutorial on them.
I’m going to rely on the Superstore dataset. Let’s start by visualizing our customers and the revenue from them on a descending bar chart.
Then, while the 80% threshold might be true in most cases, it would be much better if we could define it dynamically. For this let’s define a parameter called ‘% Threshold’. Let’s limit the allowable values to the range of 1-100 (it is a percentage after all). For better handling later, I also restricted the steps to 1.
Now we need a calculated field that tells us whether single bars are within the threshold. Let’s call this ‘Revenue in Threshold’. What this field needs to do, is tell us whether the running total of the revenues from our view is equal or less than the threshold percentage of the total. Using the table calculations from Tableau it looks like this:
This will give us True if the customer is within the threshold and False otherwise. One very important thing is that this will only work properly if you sort your customers in descending order in your view, as the calculation utilizes their positions. Please also note that because how we use the threshold parameter, we’ll need to set it to the percentage of revenue for which we are interested in the customers.
We can now drag this new measure onto Color and that will highlight those categories that fall within the threshold. (Note: on the screenshot here the threshold is 20% for demonstration purposed, for the true 80/20 rule, it should be 80%)
You can also expand the view with a line chart showing the running total of percentages. The resulting arrangement is commonly referred to as the Pareto chart. Tableau online help has a good tutorial for that. It’s just as easy as what we’ve above now.
This is what you get:
Hope this helps you find those vital few!
(Taking a look at the image in the beginning that shows the full range of customers, you can see that the rule is not quite true here. It’s more of an 80/50 situation)
Credit to Jonathan Drummey for his answer on the Tableau community forum.
If you have any question just write us. 🙂