title: MDX query for average of sums by month and year
body: <p>I'm stuck on a MDX query... I have a table which looks like:</p>
  
  <pre><code>Date         Client        Amount
  ---------------------------------
  2010-01-01        1          1000
  2010-01-01        2           500
  2010-01-02        1          1100
         ...      ...           ...
  2011-09-30        3          2000
  </code></pre>
  
  <p>Basically, I'd like to have a MDX equivalent of the following T-SQL:</p>
  
  <pre><code>SELECT [Year], [Month], AVG(DailyTotal)
  FROM (
      SELECT [Year], [Month], [Day], SUM(Amount) as DailyTotal
      FROM Table
      GROUP BY [Year], [Month], [Day]
  )
  GROUP BY [Year], [Month]
  </code></pre>
  
  <p>I'm trying to get as result like</p>
  
  <pre><code>        Jan    ...   Sept
  2010    AVG    ...    AVG
  2011    AVG    ...    AVG
  </code></pre>
  
  <p>Thanks in advance</p>