Create a Percent of Total in Tableau That Isn't Affected by Filters

As you likely know from using Table Calculations in Tableau, they only compute against the marks displayed in a worksheet. Check out this webinar in you need a refresher.

That means when a filter is applied to the worksheet, a table calculation will update to reflect only the data present in the worksheet.

Take this chart for instance:

44-1.png

If we filter the Technology category out of the view, the remaining bars will still add up to 100%:

44-2.png

If we want the percentages to remain stable even if data is filtered out of the view, we need to compute the percentages before the filters. Because table calculations compute after the filter, we need a different solution.

Notice in Tableau’s order of operations that totals and Table Calculations happen after Dimension Filters but FIXED expressions occur beforehand.

44-3.png

So instead of Tableau’s default percent of total calculation:

44-4.png

We’re going to create our own using the curly braces from the FIXED expression.

44-5.png

This ensures the FIXED denominator won’t be affected by dimension filters so the % won’t change when filters are applied:

44-6.png

Looking for help on a Tableau problem? Sign up for an office hour to get help from an expert so you can move on to bigger and better things!