title: Power BI: DAX formula - build sum on group ID
body: <p>I am just getting started with Power Bi and now I require some help.</p>
  
  <p>I need a formula that creates a new column (called "Combined" in below example picture) that uses the following logic:</p>
  
  <ul>
  <li>build the <strong>sum</strong> of column <strong>Current</strong> over <strong>each ParentID</strong></li>
  <li>if this sum is <strong>> 0</strong></li>
  <li>then write the row value of Current in the Combined column cell</li>
  <li>else insert the <strong>Budget</strong> value instead</li>
  </ul>
  
  <p>On the left side you see my current result and the desired output on the right.</p>
  
  <p><a href="https://i.stack.imgur.com/4VxyI.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4VxyI.png" alt="example "></a></p>
  
  <p>I hope you can help me out.</p>
  
  <p><strong>Update</strong>:</p>
  
  <p>To make the example a bit clearer, I combined both ParentIDs:
  <a href="https://i.stack.imgur.com/cu7vw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/cu7vw.png" alt="ex2"></a></p>
  
  <p>Thank you.</p>