2 Replies Latest reply on May 25, 2016 2:14 AM by Rajat Amin

    Last Year Sales

    Dyna Lee

      Hi everybody


      I tried to get the last year sales from the Chosen year but somehow it always Show the sales of this year. Do you guys know how I can do it?


      Thanks a lot and best regards



        • 1. Re: Last Year Sales
          Rajat Amin

          Hi Dyna,


          Please find the attached tableau file.




          Rajat Amin

          • 2. Re: Last Year Sales
            Andrew Watson

            With your filter you're actually removing 2012 from the dataset so will be unable to show last year with that implementation. I suggest you use a parameter instead of a filter. You can build a calculated field using the parameter to show last year as well. Something like:


            IF YEAR([OrderDate[) >= [YearParameter] - 1 AND YEAR([OrderDate[) < [YearParameter] + 1 THEN 'Show' ELSE 'Hide' END


            Put that calculation on the filter shelf and set to Show, it should then display the year selected and the previous year.