title: Sum If in Power Query
body: <p>How can I sum a column if the value is less than a certain value and matches another value.</p>
  
  <p><img src="https://i.stack.imgur.com/2VtTP.png" alt="Example Data"></p>
  
  <p>I have put this together in Excel but now need to replicate it in Power Query. The Opening Stock Column is what I am trying to achieve. In Excel the formula in Cell D3 down is</p>
  
  <pre><code>=SUMIFS(B:B,C:C,"&lt;"&amp;C3,A:A,A3)
  </code></pre>
  
  <p>So basically I want to sum Column B if column C is less than the current value in column C and if Column A matches the current value in column A</p>
  
  <p>How is this written in Power Query</p>
  
  <p>Any help would be appreciated.</p>
  
  <p>Thanks</p>
  
  <p>Simon</p>