title: Power BI - Cumulative SUM filtered by current row values
body: <p>I have a table with three columns - list_id, id, daily_return. id is basically a number sequence increment, reset for every list_id.</p>
  
  <pre><code>Example:
  list_id id  daily_return
  1       1   0.2
  1       2   0.18
  1       3   0.35
  2       1   0.15
  2       2   0.18
  2       3   0.23
  </code></pre>
  
  <p>I need to create a calculated measure on the chart I am creating such that it creates a running total of daily_return for the same list_id, ordered by the id column.</p>
  
  <p>I am creating a measure in the chart, since I want the rows to be filtered by the user and the calculation itself will be more complex.</p>
  
  <p><strong>How do I get the current list_id and id, so I may use it in my formula?</strong></p>
  
  <p>This is what I have so far. I tried using EARLIER/EARLIEST without success.</p>
  
  <pre><code>cumulative_return = CALCULATE(SUM('CMC Daily Return'[daily_return]), 'CMC Daily Return'[list_id]=EARLIER([list_id]), 'CMC Daily Return'[id]&lt;=EARLIER([id]))
  </code></pre>