It can be hard to wrap your head around how Tableau uses table calculations. You might be content just using the quick table calculations, but if you’re reading this blog you probably want to understand what is happening, not just rely on Tableau’s magic. This blog post will guide you through the process in plain English.
First things first, table calculations are not just for tables 😉 They are calculations that can be used on any numbers in your view.
Here’s how to create a table calculation, right-click on a measure such as the sum of sales and then click the add table calculation option.
You will then see this menu:
This menu can look quite confusing, but don’t worry, below you’ll see it all explained.
As you can see, it’s not as straightforward as it could be, it’s confusing just to start at the top and make your way down.
One important thing to note is that there is some reverse logic here. You start by unchecking the variable you are interested in rather than checking it.
In this example, we are interested in how each ship mode performs over time. That is why we unselect the ship mode and select the week of ship date.
Thinking about table calculations like this in a plain English sentence makes it clearer. Because we are interested in how each ship mode performs over time, we can structure our sentence like this:
For each ship mode calculate the running total by week of ship date.
Next time you’re stuck trying to figure out how to make a table calculation work, thinking about how you might say it in a plain English sentence like this might be just what you need to get unstuck.