5 Replies Latest reply on Jan 10, 2013 11:51 AM by Mark Holtz

    Average vs. window_avg

    Elizabeth Coleman

      Hello,

      I have a formula where I'm using window_avg with sum over the last two year where I get a different results than when I use 'Average' in my Excel worksheet.  The sum of the last 12 months in Tableau is the same as in Excel:  12,038,274. 

       

      For instance Project manager completed 12,038,274 in revenue in 2012, I want to know what is the average revenue year-to-date.  When I calculate the average revenue in Excel:  12,037,274/12 = 1,003,189.

       

      Using the Window_Avg formula the result is 969,651.

       

      The formula is made of two parts:  IF Year([Fiscal Month])=Year([Fiscal Month Filter]) and Month ([Fiscal Month])<=Month([Fiscal Month Filter]) then [Actual Equip $ Sum] End

       

      IF First ()=0 THEN Window_Avg(Sum(YTD Actual Equip $ Sum]),0,IIF(First()=0,Last(),0)) End.

       

      Can you explain why I'm getting different results using window_avg vs Average?