title: How to add a calculated member based on group / subgroups
body: <p><em>Hi, i have a new challenge for MDX.
  i defined this mdx:</em></p>
  
  <pre><code>WITH 
    MEMBER [Measures].[SubGroupID] AS 
      [Dim Customer].[Customer SubGroup ID].CurrentMember.Member_Caption 
    MEMBER [Measures].[MainGroupID] AS 
      [Dim Customer].[Customer MainGroup ID].CurrentMember.Member_Caption 
  
  SELECT 
    NON EMPTY 
      {
       [Measures].[SubGroupID],
       [Measures].[MainGroupID],
       [Measures.[SalesAmount]
      } ON COLUMNS
   ,NON EMPTY 
      {
          [Dim Customer].[Customer ID].[Customer ID].MEMBERS * 
          [Time].[Year -  Month -  Date].[Date].MEMBERS
      }
    DIMENSION PROPERTIES 
      MEMBER_CAPTION
     ,MEMBER_UNIQUE_NAME
     ON ROWS
  FROM 
  (
    SELECT 
      {
          [Time].[Year -  Month -  Date].[Date].&amp;[2015-01-01T00:00:00]
        : 
          [Time].[Year -  Month -  Date].[Date].&amp;[2015-01-05T00:00:00]
      } ON COLUMNS
    FROM [Cube]
  );
  </code></pre>
  
  <p><em>The result shows me the rowset below:</em></p>
  
  <p>CustomerID / Date / SubGroupID /  MainGroupID /  SalesAmount         </p>
  
  <p>1 / 1.1.2015 /  SG1  / MG1 /  11<br>
  1 / 2.1.2015 /  SG1  / MG1 /  12<br>
  1 / 3.1.2015 /  SG1  / MG1 /  13<br>
  1 / 4.1.2015 /  SG1  / MG1 /  14<br>
  1 / 5.1.2015 /  SG1  / MG1 /  15<br>
  2 / 1.1.2015 /  SG1  / MG1 /  16<br>
  2 / 2.1.2015 /  SG1  / MG1 /  17<br>
  2 / 3.1.2015 /  SG1  / MG1 /  18<br>
  2 / 4.1.2015 /  SG1  / MG1 /  19<br>
  2 / 5.1.2015 /  SG1  / MG1 /  20<br>
  3 / 1.1.2015 /  SG12 / MG1 /  21<br>
  3 / 2.1.2015 /  SG12 / MG1 /  22<br>
  3 / 3.1.2015 /  SG12 / MG1 /  23<br>
  3 / 4.1.2015 /  SG12 / MG1 /  24<br>
  3 / 5.1.2015 /  SG12 / MG1 /  25<br>
  4 / 1.1.2015 /  SG1  / G21 /  26<br>
  4 / 2.1.2015 /  SG1  / G21 /  27<br>
  4 / 3.1.2015 /  SG1  / G21 /  28<br>
  4 / 4.1.2015 /  SG1  / G21 /  29<br>
  4 / 5.1.2015 /  SG1  / G21 /  30             </p>
  
  <p><em>now i want two new colums which shows me the summary per day for subgroup and maingroup:</em>
  <em>below the result set with the 2 new columns and how i´like to calculate</em></p>
  
  <p>CustomerID / Date / SubGroupID / MainGroupID /  SalesAmount / SalesAmountSubGroup in MainGroup / SalesAmountMainGroup /</p>
  
  <p>1 / 1.1.2015 / SG1  / MG1  / 11 / x = 11 + 16 / y = 11 + 16 + 21<br>
  1 / 2.1.2015 / SG1  / MG1  / 12 / x = 12 + 17 / y = 12 + 17 + 22<br>
  .
  .<br>
  3 / 1.1.2015 / SG12 / MG1 / 21 / x = 21   / y = 11 + 16 + 21<br>
  3 / 2.1.2015 / SG12 / MG1 / 22 / x = 22   / y = 12 + 17 + 22<br>
  .
  .
  4 / 1.1.2015 / SG1  / MG21 / 26 / x = 26      / y = 26<br>
  4 / 2.1.2015 / SG1  / MG21 / 27 / x = 27      / y = 27<br>
  .
  .</p>
  
  <p><em>i´m sure sombody has an idea.
  Thanks in advance</em></p>