Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

Date Filtering - Fiscal Year

I have the dates aligned to follow the fiscal year, but the data is still showing from last year. July starts our fiscal year, I want the data to populate as we go through the months. So in the photo...
  • jennratten's avatar
    jennratten
    4 years ago

    Okay, so you would just need some slight modifications for the year.  Try this please..

     

    FYYearNum =
    
    VAR FYStartMonth = 7
    VAR CurrentYear = Year ( TB_MDH_DATA_DAILY_MONTHLY[DT] )
    VAR CurrentMonth = Month ( TB_MDH_DATA_DAILY_MONTHLY[DT] )
    VAR PriorYear = CurrentYear - 1
    
    RETURN
    IF ( CurrentMonth >= FYStartMonth, PriorYear, CurrentYear )