Tableau: Dynamically Display The Last n Months From Today
Updated: May 13, 2021

Step 1:
Build a bar chart using Month([Date]) and sum([Sales])

Step 2:
Create a new parameter as an integer. Set the default value to 12

Step 3:
Write a calculation to test if the month is greater than or equal to today’s date minus n months. Pass the parameter into the n value.
DATETRUNC('month', [Date])
>=