title: Microsoft Power BI: RANKX AND AGGREGATION OF RESULT
body: <p>I am having an issues ranking a set of rows then getting the total to use as input to another calculation. I have attempted nested CALCULATE statements and intermediate table using CALCULATETABLE unsuccessfully.
  Scenario is as follows:</p>
  <p>Original table</p>
  <pre><code>Item Sales
  A     3
  B     4
  C     2
  D     7
  E     5
  </code></pre>
  <p>Ranking top N (3)</p>
  <pre><code>Item Sales
  D     7
  E     5
  B     4
  TOTAL 16
  </code></pre>
  <p>In this example, I am interested in the value 16 for onward processing</p>