4 Replies Latest reply on Mar 10, 2016 8:05 AM by Jay Zen

    Average of Table Calculation

    Jay Zen

      Hi,

       

      I'm currently calculating a year-on-year change between two values using the following formula:

       

      IF NOT ISNULL(SUM([Value]))

      THEN (ZN(SUM([Value])) - LOOKUP(ZN(SUM([Value])), -1)) / LOOKUP(ZN(SUM([Value])), -1)

      END

       

      This produces the correct result (going across the table). However, no matter what I try (whether using totals or other calculations), I cannot seem to get a correct average of all of the resulting outcomes.

       

      Tableau either calculates nothing, or first calculates an average of [Value] for each year, which it then calculates a year-on-year change on. What I want is an average of just the percentages that result from the above calculation for each entry in my data.

       

      Thanks for your help,

       

      Jay