Advance with Assist: Creating a Distribution of Sales in Tableau

Data

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
How Assist by InterWorks Supports Your Entire Data Stack Assist by InterWorks has been helping hundreds of InterWorks clients for years now. Assist got its beginnings as an on-demand, Tableau ...
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 ...

See more from this author →

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
Germany
Geschäftsführer: Mel Stephenson

Kontaktaufnahme: markus@interworks.eu
Telefon: +49 (0)211 5408 5301

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

×

Love our blog? You should see our emails. Sign up for our newsletter!