×

Data

# Advance with Assist: Options for Calculating Percentages

Advance with Assist shares quick solutions to common challenges encountered by the InterWorks Assist on-demand team.

Question: My calculation for percentage isn’t returning the right values, but the data is there. I’m getting the sum of a single product, not the full sum. What do I need to do?

Understanding what Tableau does with calculations and aggregations is important when building calculated fields. All of us have found ourselves in similar situations as this user. Now, in this example there are many ways to approach the question. I will show three ways to get the desired results she was after:

1. Quick Table Calculation
2. Calculated Field
3. LOD

## Quick Table Calculation

This is the simplest option and the one that I would try first. Table calculations are common functions built into Tableau for you to use. One of those options is Percent of Total. These calculations also allow you to compute the calculations depending on how you’ve set up your view.

The Quick Table Calculation appears when you right-click a measure pill in your Tableau user interface:

Showing compute:

The user now had the percentages she was after.

## Calculated Field

Quick calculations can be made into fields by dragging the pill with the delta symbol to the data window. By doing this, you can see the calculation that Tableau is using to compute the percentage:

## LOD

One last note for this question is just an expansion of the concept above. This would be using LOD calculations. In the above example, there is a filter on Product Name to only keep those five products, but there are far more products in my sales data. Table calculations only use the data you’ve narrowed for calculation. Maybe a secondary question here is: what is the percentage across all products instead of just these five? LOD may be a good approach.

For this, we will have two logical steps: how many products sold across the company, and the number of product sold by each name.

So the calculation would look like this:

Replace fields in this example with your data to see how this can be applied. Hope you find this useful!

### KeepWatch by InterWorks

Whether you need support for one platform or many, our technical experts have you covered.

## Dustin Wyers

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!