9 Replies Latest reply on Oct 30, 2017 10:00 PM by haitham Farouk

    Sum and Average based on selected filter

    yamuna.kosireddi

      Hi ,

      I have product type in filter and i have calculated average daily sales .now i wanted to filter my average daily sales by product type.

      below is the example.

      lets say...Under product type there are three types . for each type again there are 3 subtypes.

      lets 3 product types are furniture,office supplies and Technology

      if i selected furniture average should come .if i selected furniture and technology.....sum(avg(furniture)and avg(technology) should come. i think looks like a pretty basic calculation but cant figure out.

       

      I tried with a below calculation

      ((sum([sales])/COUNTD([Sub category])/[nOOF DAYS ytd]))

       

      No of days calculation:

      DATEDIFF('day',MIN([Date]),MAX([Date]))+1

       

      this calculation gives correct value if one product is selected but if i selected more than one , it is giving average ,i want some.please help me

       

      Thanks

      Yamuna