10 Replies Latest reply on Dec 18, 2017 5:28 AM by Norbert Maijoor

    Displaying Average on aggregated level with dynamic date period

    Hampus Ny

      Hi!

       

      I'm having forecasts for a number of articles on day level, and planned stock level for each of those articles for each day in the period.

      In my graphs i visualize the planned stock as bars, and the forecast as a line. I have enabled a filter on articles, making me able to see all articles, or specific ones.

      In my column I have date which is adjustable (day, week, month, year) as seen below. The planned stock is based on average per period, which is performing the way I want to.

       

      My problem is when I aggregate several/all articles. Since I'm only taking the average of all articles, it just takes all articles in the selection of the day, and takes the average of them.

      I instead want the calculation to add all demand for every day, then take the average over the filtered period, as seen below.

       

      ArticleDemandDay
      A301
      B501
      C701
      A402
      B202
      C302

       

      Average of the three articles:

      Day 1: (30+50+70)/3=  50

      Day 2:  (40+20+30)/3=  30

      Average for period: (50+30)/2=40

       

      This is not the way I want the calculation to be done. I want it to be done like below:

       

      Day 1: 30+50+70=150

      Day 2: 40+20+30=90

      Average for period: (150+90)/2=120

       

      Also, the calculation should only consider articles filtered.

      Is this something that is possible to do in Tableau?