top of page

Tableau: How to Filter Dates While Calculating % Difference

Updated: May 13, 2021

Filters can cause problems when using table calculations in Tableau. Here's a trick to use a filter while also using table calculations. We'll use the lookup function to force the filter to be applied after all other calculations.

Step 1:

Build a line chart using Month([Date]) and sum([Sales])

Step 2:

Copy the sales pill, and add a quick table calculation; Percent Difference

Step 3:

Add a filter for the year 2020 only. The data is now filtered to 2020, but January is missing a percent difference value. The table calculation will not work when data is filtered out.