title: MDX aggregate out a dimension
body: <p>I'm trying to compute outcome frequencies, i.e., count divided by total.</p>
  <p>I can't work out how to get a total in MDX.</p>
  <p>Data looks like this.</p>
  <p><a href="https://i.stack.imgur.com/Rbxe2.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Rbxe2.png" alt="enter image description here" /></a></p>
  <p>The <em>fact</em> is just a 1 so their sum is the number of experiments with the given outcome.</p>
  <p>It's easy in SQL</p>
  <pre><code>SELECT Session, Outcome, fi / N AS p
  FROM (
      SELECT Session, Outcome, CAST(COUNT(*) AS float) AS fi, CAST(SUM(COUNT(*)) OVER (PARTITION BY Session) AS float) AS N GROUP BY Session, Outcome
  ) T
  </code></pre>
  <p>Is it possible in MDX? If so: how?</p>
  <p>I've tried these:</p>
  <pre><code>CREATE MEMBER CURRENTCUBE.Measures.Experiments AS SUM([Outcomes] , Measures.[Actual Outcome]);
  CREATE MEMBER CURRENTCUBE.Measures.ExperimentsA AS SUM([Outcomes].[(All)] , Measures.[Actual Outcome]);
  CREATE MEMBER CURRENTCUBE.Measures.ExperimentsAM AS SUM([Outcomes].AllMembers , Measures.[Actual Outcome]);
  </code></pre>
  <p>The first and third just give <code>(null)</code> and the second is just the same as the existing measure -- which makes no sense.</p>