title: How to perform a Distinct Sum using MDX?
body: <p>So I have data like this:</p>
  
  <pre><code>Date       EMPLOYEE_ID   HEADCOUNT   TERMINATIONS
  1/31/2011        1            1             0 
  2/28/2011        1            1             0
  3/31/2011        1            1             0
  4/30/2011        1            1             0
  ...
  1/31/2012        1            1             0
  2/28/2012        1            1             0
  3/31/2012        1            1             0
  
  1/31/2012        2            1             0
  2/28/2011        2            1             0
  3/31/2011        2            1             0
  4/30/2011        2            0             1    
  
  1/31/2012        3            1             0
  2/28/2011        3            1             0
  3/31/2011        3            1             0
  4/30/2011        3            1             0
  ...
  1/31/2012        3            1             0
  2/28/2012        3            1             0
  3/31/2012        3            1             0
  </code></pre>
  
  <p>And I want to sum up the headcount, but I need to remove the duplicate entries from the sum by the employee_id.  From the data you can see employee_id 1 occurs many times in the table, but I only want to add its headcount column once.  For example if I rolled up on year I might get a report using this query:</p>
  
  <pre><code>with member [Measures].[Distinct HeadCount] as
            ??? how do I define this???
  select { [Date].[YEAR].children } on ROWS, 
         { [Measures].[Distinct HeadCount] } on COLUMNS 
         from [someCube]
  </code></pre>
  
  <p>It would product this output:</p>
  
  <pre><code>YEAR    Distinct HeadCount
  2011           3
  2012           2
  </code></pre>
  
  <p>Any ideas how to do this with MDX?  Is there a way to control which row is used in the sum for each employee?</p>