title: MDX how to get total sum for sub groups?
body: <p>I have MDX query like following:</p>
  
  <pre><code>SELECT
  NON EMPTY { [Measures].[Sales Amount] } ON COLUMNS,
  NON EMPTY { ([Customer].[City].[City] * [Customer].[Gender].[Gender] ) } ON ROWS
  FROM [Analysis Services Tutorial]
  </code></pre>
  
  <p>This MDX Query gets following table result as you know:</p>
  
  <pre><code>|---------------------|-----------|---------------|
  |        City         |   Gender  |  Sales Amount |
  |---------------------|-----------|---------------|
  |     Ballard         |     F     |    300        |
  |---------------------|-----------|---------------|
  |     Ballard         |     M     |    500        |
  |---------------------|-----------|---------------|
  |     Berkeley        |     F     |    200        |
  |---------------------|-----------|---------------|
  |     Berkeley        |     M     |    100        |
  |---------------------|-----------|---------------|
                        .
                        .
                        .
  </code></pre>
  
  <p>But I need sub totals in the table like that:</p>
  
  <pre><code>|---------------------|-----------|---------------|
  |        City         |   Gender  |  Sales Amount |
  |---------------------|-----------|---------------|
  |     Ballard         |     F     |    300        |
  |---------------------|-----------|---------------|
  |     Ballard         |     M     |    500        |
  |---------------------|-----------|---------------|
  |     Ballard         |    All    |    800        |
  |---------------------|-----------|---------------|
  |     Berkeley        |     F     |    200        |
  |---------------------|-----------|---------------|
  |     Berkeley        |     M     |    100        |
  |---------------------|-----------|---------------|
  |     Berkeley        |    All    |    300        |
  |---------------------|-----------|---------------|
                        .
                        .
                        .
  </code></pre>
  
  <p>Is there any suggestion to do that in MDX? Any help would be appreciated. Thanks</p>