# The Total function in Tableau & partitions

> This is content from just-tim, the data-and-analytics channel by Tim Ngwena (formerly 'Tableau Tim'). Tim has 12+ years of hands-on BI experience and covers Tableau most of all, plus Power BI, Looker, Hex, SQL and data modelling, the analytics industry, and the craft of doing the job — always tool-agnostic and honest about the trade-offs.

- **Author:** Tim Ngwena (just-tim, https://just-tim.com/about)
- **Published:** 2021-02-08
- **Format:** Video · 11 min watch · transcript available
- **Topics:** Data visualisation, Analytics
- **Tools:** Tableau (calculated fields, table calculations, total)
- **Canonical:** https://just-tim.com/posts/the-total-function-in-tableau-partitions
- **Watch:** https://youtu.be/rhaI-F_tFgU

I explain the TOTAL function in Tableau and why it shouldn't be thought of as a mathematical total. To do this properly I also cover the concept of a partition, showing how table down, pane down and other compute-using settings change the result, and how TOTAL behaves with SUM versus AVG.

## Key takeaways

- TOTAL computes a single value across the whole partition and then repeats that value in every cell, so it isn't the same as SUM.
- A partition defines the direction Tableau looks when calculating; table down looks at the entire table while pane down looks at each individual pane.
- Adding more pills to the rows shelf shrinks the definition of a pane, which changes what TOTAL returns.
- TOTAL(AVG([Sales])) returns the average of every underlying record in the partition, not the average of the visible aggregated values, which is a common source of confusion.
- Think about what the function actually does rather than its name, since TOTAL works with any expression including averages.

## Chapters

- 0:14 Building a simple table
- 0:54 TOTAL versus SUM
- 2:13 Understanding partitions
- 3:26 Switching to pane down
- 5:19 Panes, hierarchies and direction of travel
- 7:28 TOTAL with averages
- 9:57 Summary and further reading

Watch the full video, read the transcript and use chapter deep-links on the page: https://just-tim.com/posts/the-total-function-in-tableau-partitions

---
just-tim — Data and analytics, with a point of view. · https://www.youtube.com/channel/UC7HYxRWmaNlJux-X7rNLZyw · https://twitter.com/TableauTim · https://www.linkedin.com/in/timngwena
