Advance with Assist: Options for Calculating Percentages

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?

Advance with Assist calculating percentages

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:

Advance with Assist quick table calculation

Showing compute:

Advance with Assist quick table calculation, percent of total

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:

Advance with Assist calculated field

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:

Advance with Assist LOD calculation

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

Want More Advance with Assist

  1. Advance with Assist: Filtering Select Dates with DATETRUNC
  2. Advance with Assist: Enhancing Dashboards with Custom Icons
  3. Advance with Assist: Tableau Power User Leaving the Company
  4. Advance with Assist: Context Filters and LOD Calculations
  5. Advance with Assist: Custom Subscriptions with Tableau Server Custom Views
  6. Advance with Assist: Blending with Dimension Not Utilized
  7. Advance with Assist: Creating a Sankey Diagram from Survey Data
  8. Advance with Assist: Multiple Dashboard Actions with a Single Click
  9. Advance with Assist: Refreshing Tableau Online Data with Tableau Bridge
  10. Advance with Assist: Parameter Performance Optimization
  11. Advance with Assist: Using Custom Backgrounds with Polygon Shapefiles
  12. Advance with Assist: Changing Default Properties on Data
  13. Advance with Assist: Options for Calculating Percentages
  14. Advance with Assist: Removing Options from Filter List
  15. Advance with Assist: Extracting Year from De-identified Text String
  16. Advance with Assist: Marking the Latest Date on Trend Line
  17. Advance with Assist: What You Need to Know About Aliases
  18. Advance with Assist: Function Compatibility
  19. Advance with Assist: Mass Parameter Replacement
  20. Advance with Assist: Sorting with MONTH in Reverse
  21. Advance with Assist: Ungroup Column Headers That Have Concatenated
  22. Advance with Assist: Connectionless Failure Error in Tableau Server
  23. Advance with Assist: How to Exceed Tableau’s Column or Row Limit
  24. Advance with Assist: Adding Email Links to Your Dashboard
  25. Advance with Assist: Saving User-Selected Filters on Tableau Server
  26. Advance with Assist: Tableau and Named Ranges in Excel
  27. Advance with Assist: Editing Custom Fields in Tableau-Published Data Sources
  28. Advance with Assist: NOW and TODAY Functions in Tableau
  29. Advance with Assist: Sheet Swapping with Dummy Headers
  30. Advance with Assist: REST Error in Tableau and Snowflake Connection
  31. Advance with Assist: Mapping with One Data Row in Tableau 2019.2
  32. Advance with Assist: Multi-Number Formats for Single Calculations
  33. Advance with Assist: Removing Background Landmass on a Tableau Map
  34. Advance with Assist: Filtering Data Sources on Tableau Server
  35. Advance with Assist: Swapping Sheets in Tableau 2019.2
  36. Advance with Assist: Filling in Null Records Without Filtering

More About the Author

Dustin Wyers

Analytics Consultant | Assist Lead - East
Advance with Assist: Filling in Null Records Without Filtering Question: I’m using a table calculation comparing the same month last year, and my view shows blanks due to the date range I have ...
Advance with Assist: Swapping Sheets in Tableau 2019.2 Tableau 2019.2 is full of new features. To name a few, vector maps, parameter actions, show/hide dashboard containers and spatial ...

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
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