
Tableau: Calculate 14 Day Change in Covid Cases
Updated: May 14, 2021
Step 1:
Start with date on rows, and sum([Cases]) on Text

Step 2:
Create a lookup calculation to find the value from 14 days ago. Lookup(sum([Cases]),-14)

Step 3:
Calculate the difference by subtracting the two.
Sum([Cases]) – [14 Days Ago]

Step 4:
If you add a dimension like state, adjust the partitioning of the table calculation
Step 5:
Click the dropdown on your lookup and difference pills. Choose edit table calculation.

Step 6:
Uncheck any dimension where you want the lookup to be repeated. In this case, we want 14 days ago for each state. (unchecked state)
