title: Dynamic weekly average per category
body: <p>I have a dataset as follows:</p>
  
  <pre><code>DATE       | AMOUNT | CATEGORY
  20.12.2015 | 100.00 | Drinks
  22.12.2015 | 50.00  | Food
  20.12.2015 | 70.00  | Transport
  07.12.2015 | 50.00  | Transport
  ...
  </code></pre>
  
  <p>There are several records with amounts spent per week and day.</p>
  
  <p>I would like to have a bar chart with the categories on the left and the length of the bars indicating the weekly average, ie. what is spent on average per week during a filtered time frame </p>
  
  <p>If I user the normal <code>AVG([AMOUNT])</code> it calculates the daily average, rather than the weekly one.</p>
  
  <p>I found this question:
  <a href="https://stackoverflow.com/questions/28951442/tableau-weekly-average-from-daily-data">Tableau - weekly average from daily data</a></p>
  
  <p>However one of the answers is not dynamically, the other lists averages for consecutive weeks, rather than per category and I can't think of a way to apply the same technique for mmy problem.</p>