12 Replies Latest reply on Feb 22, 2016 10:42 AM by Vishal Sarkar

    How to calculate moving average and moving sum based on year selection in filter

    Vishal Sarkar



      I am new to tableau. I would like to understand about one of the calculated metric that I am using. So I need to calculate the average and sum of a metric which should change dynamically based on years selection done in filter. For eg : if i select 2007-2009 then it should show average and sum for 3 years only and likewise. I have made a first crack by identifying the function to be used i.e window_avg and window_sum. So I am doing window_avg(sum(metric),"start","end") and window_sum(sum(metric),"start","end"). I am not sure what should I put in "start" and "end" parameter here.


      Can someone guide me this. Thanks in advance!