title: DAX | Sum up rows for a column based on conditions in another column
body: <p>I am new to DAX, I have a data which looks like -</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>col1</th>
  <th>col2</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>A</td>
  <td>20</td>
  </tr>
  <tr>
  <td>A</td>
  <td>10</td>
  </tr>
  <tr>
  <td>B</td>
  <td>30</td>
  </tr>
  <tr>
  <td>B</td>
  <td>20</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>My output should be -</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>col1</th>
  <th>col2</th>
  <th>col3</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>A</td>
  <td>20</td>
  <td>30</td>
  </tr>
  <tr>
  <td>A</td>
  <td>10</td>
  <td>30</td>
  </tr>
  <tr>
  <td>B</td>
  <td>30</td>
  <td>50</td>
  </tr>
  <tr>
  <td>B</td>
  <td>20</td>
  <td>50</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I have tried writing a measure but it dosnt work -</p>
  <pre><code>col3 =
  CALCULATE (
      SUM ( Sheet1[col2] ),
      FILTER (
          ALLSELECTED ( Sheet1 ),
          Sheet1[col1] == Sheet1[col1]
      )
  )
  </code></pre>