12 Replies Latest reply on Jan 15, 2020 12:36 PM by madhuri.tanniru

    Get Last Year's Sales with Start/End Date Parameter?

    starrynight104

      Hi All,

       

      Feel like this question should be somewhere in the forums but can't seem to find one specific to this case.

       

      Essentially I have a Start Date and an End Date Parameter (2 parameters). The user uses these to filter the current dashboard I have. I'm hoping to create a measure for Last Year's Sales amount based off the Start/End Date range the user selects. So if the user selects 1/1/20 to 1/15/20, the Last Year Sales amount will be in reference to 1/1/19 to 1/15/19.

       

      I created this formula to get Last Years Sales:

      IF [FISCAL_DT]>=([Start Date]-365)

      AND [FISCAL_DT]<=([End Date]-365)

      THEN [SALE_AMT]

      ELSE NULL

      END

       

      However, I keep getting blanks with this formula. Not sure what I'm doing wrong.

       

      Also, I was wondering how to make the periods dynamic, as well. So a user can select with another Period parameter whether they want to see relative Month, Week, or Year Data and also another N Periods Back parameter to select how many months/weeks/or years back they want to see relative Sales for. However, I can't even get last year's sales so this would come after, I'd think.

       

      Does anyone know what I'm doing wrong with above formula or how to resolve this and possibly add those other dynamic parameters in?

       

      Thanks so much!