3 Replies Latest reply on Oct 1, 2018 8:08 AM by Shinichiro Murakami

    Average sales, excl. last 12 months, compared to last 12 month sales

    Boreak Silk

      Hi Tableau Community,

      I'm trying to compare sales of the last 12 months with long-term average excluding the last 12 month sales.

      I came up with a LOD calculation below

       

      { FIXED DATEPART('month',[Date]), [Category] :

      AVG({ FIXED DATEPART('year',[Date]), DATEPART('month',[Date]), [Category]:

      ZN(SUM([Value]))})}

       

      but it includes the last 12 month sales, how do I exclude the last 12 month sales from this average calculation?

      Or any other solution? I read some solutions with Today() function but I am looking for a solution using MAX

      month to determine the latest 12 months. Attached is the workbook.

       

      Thank in advance.

       

      Bo