KNOWLEDGE BASE

How to display data for selected past fiscal years along with the most recent fiscal year


Published: 31 Mar 2022
Last Modified Date: 04 Apr 2022

Question

How to display data for selected past fiscal years along with the most recent fiscal year.

Environment

  • Tableau Desktop

Answer

-Setting the Fiscal Year-
1. Connect to Sample -Superstore
2. Create a new Calculated field like the following.
    Name : FY
    Calculation : DATE(DATEADD('year', -1, [Order Date]))
3. Right-click on [FY] > Default Property > Fiscal Year Start > Setting month you want
   //This time set in April.
4. Drag [FY] to Columns.
5. Drag [Sales] to Text.

-Create Parameter-
6. Right-click on [FY] > Create > Custom Date > setting as following.
User-added image
6. Right-click on FY (Years) > Create > Parameter > setting as following.
User-added image
7. Right-click on [Past Fiscal Year] > Show Parameter

-Sales calculation for the Past Fiscal Year-
8. Create a new Calculated Field like the following.
    Name : Sales - Past FY
    Calculation : lookup(SUM([Sales]),[Past Fiscal Year]-2021)
9. Drag [Sales - Past FY] to Cross tab
User-added image
-Displaying only the latest year in the view-
10. Create a new Calculated Field like the following.
    Name : Latest Year Filter
    Calculation : lookup(attr([FY (Years)]),0)=2021
11. Drag [Latest Year Filter] to Filter Pane > Check 'True'.

Note: Current fiscal year is set to 2021 in the above example.
Did this article resolve the issue?