1 Reply Latest reply on Sep 2, 2015 4:42 PM by Esther Aller

    Average with respect to the year should display based on filter selection

    lalitha p

      Hi Everyone,


          I have a requirement like this,


      Year                    sales

      2011                     100

      2012                     200

      2013                     300

      2014                     400

      2015                     500


      I need one more column which is Average , but it should display like this:

      (I have a filter Year)

      say, If i click on 2013 then my data should be like this:


      Year                      sales                           Average

      2013                       300                                200  i,e(100+200+300)/3



      If i click on 2012, my data should be ,


      Year                      sales                           Average

      2012                       200                                150  i,e(100+200)/2



      If i click on 2015, my data should be ,


      Year                      sales                           Average

      2015                       500                                300  i,e(100+200+300+400+500)/5



      That is if i select any year average should display till that year


      I have done in this way:


      I have created a calculated filed for Average like this: Total(sum(sales))


      average is displaying correct but if i select any year from the filter it is displaying 1 because only for 1 year it is calculating by this time and displaying 1 for any year if you select in the filter



      Could any one please help me out..