KNOWLEDGE BASE

How to Display Detailed Data Starting from the Selected Year and Month up to N Months Ago


Published: 17 Oct 2023
Last Modified Date: 18 Oct 2023

Question

How can we display the detailed data starting from the selected year and month up to N months ago?

Environment

  • Tableau Desktop

Answer

Follow the steps using the sample packaged workbook attached to display the detailed data starting from the selected year and month up to N months ago. In the attached sample workbook, the following views are prepared.

Bar worksheet
Columns: YEAR(Order Date) and Month(Order Date)
Rows: SUM(Sales)

Detail worksheet
Columns: YEAR(Order Date) and Month(Order Date)
Rows: SUM(Sales)

1. Create the following parameters.
User-added imageUser-added imageUser-added image

2. Create a calculated field and name it Year and Month filter.
YEAR([Order Date]) * 100 + MONTH([Order Date]) <= [Year] * 100 + [Month]
3. Create a calculated field and name it LAST N months filter.
LAST() < [LAST N months]
4. Open Detail worksheet and add Year and Month filter and select TRUE.
5. Add LAST N months filter and select TRUE.
6. Add a new dashboard and place Bar and Detail views on the dashboard.
7. Select Dashboard > Actions from the menu. Add the following Change Parameter actions.
User-added imageUser-added image
8. Select Analytics > Parameters from the menu and select Year, Month and LAST N months.
Did this article resolve the issue?