Forum Discussion

wmorris20's avatar
wmorris20
Helper II
9 years ago
Solved

Alternative for SAMEPERIODLASTYEAR()

We are looking to generate forecasts based on the prior year.  SAMEPREIODLASTYEAR works fantastic until you get to a future month.  I'd prefer not to insert blank future records in order to "fix" the...
  • bblais's avatar
    bblais
    9 years ago

    I see what it is.  You have to use the 'Time' dimension's date field in your SAMEPERIODLASTYEAR call, not the 'Sales' table which won't have values for the future dates.  And you don't need that ALL('Time') filter:

     

    PY Sales Dollars = CALCULATE([Sales Dollars],SAMEPERIODLASTYEAR('Time'[Date]))

    This assumes your date field that you join on is 'Time'[Date], adjust accordingly if it's not.