Advance with Assist: Creating a Distribution of Sales in Tableau


Advance with Assist: Creating a Distribution of Sales in Tableau

Question: How would I go about calculating how many states generate a specific percentage range of sales? Like > 10% of total sales as an example? I want to know where to target more marketing efforts. Can you help me get started?

As with most things Tableau, there are a variety of ways someone could approach this question: a combination of calculations, building a view then using table calculations, etc. I like the approach of writing multiple calculations because it simplifies my process. Both options can work, but the former is my preference.

What Is Needed

We need three pieces of information to build the view this client was after. I will use Sample Superstore data if you want to duplicate this in your Tableau workbook:

  1. Total Sales
  2. State Percentage of Total Sales
  3. The Distribution Logic desired

Total Sales

For this calculation, I decided to use a FIXED level-of-detail calculation (LOD for short). It looks like this:

LOD calculation in Tableau

State Percentage of Total Sales

Again, I will be using a FIXED LOD for this calculation but this time with the addition of the State to pull in each State level to the calc:

fixed LOD calculation in Tableau

The Distribution Logic

For this calculation, we only need to determine the final distribution logic we want for our Tableau report. The question posed mentioned >10%, so let’s build that out.

For reference, so far, our Tableau report could look something like this with these calculations added to a sales report:

distribution of sales in Tableau

distribution of sales in Tableau

You could add additional logic with ELSEIF if you needed to group more than two ranges.

My final report now gives me the states that I was after for the distribution questions:

distribution of sales in Tableau

More About the Author

Dustin Wyers

Support Lead, Americas
Tableau Conference 2021: Devs on Stage in Review As always, the keynotes from the Tableau Conference, even virtually, are always an exciting highlight, and I love getting to write ...
Advance with Assist: Finding Max Date and More Question: I have a need to determine my Current Opportunity amount and the change from whatever date was listed prior. It could be the ...

See more from this author →

Subscribe to our newsletter

  • I understand that InterWorks will use the data provided for the purpose of communication and the administration my request. InterWorks will never disclose or sell any personal data except where required to do so by law. Finally, I understand that future communications related topics and events may be sent from InterWorks, but I can opt-out at any time.
  • This field is for validation purposes and should be left unchanged.

InterWorks uses cookies to allow us to better understand how the site is used. By continuing to use this site, you consent to this policy. Review Policy OK


Interworks GmbH
Ratinger Straße 9
40213 Düsseldorf
Geschäftsführer: Mel Stephenson

Telefon: +49 (0)211 5408 5301

Amtsgericht Düsseldorf HRB 79752
UstldNr: DE 313 353 072