title: PowerBI DISTINCT SUMX in DAX
body: <p>I want to use the SUMX function in combination with DISTINCT</p>
  <div class="s-table-container">
  <table class="s-table">
  <thead>
  <tr>
  <th>ProductGroup</th>
  <th>Product</th>
  <th>Sales</th>
  </tr>
  </thead>
  <tbody>
  <tr>
  <td>Y</td>
  <td>product1</td>
  <td>5</td>
  </tr>
  <tr>
  <td>Y</td>
  <td>product2</td>
  <td>4</td>
  </tr>
  <tr>
  <td>Y</td>
  <td>product1</td>
  <td>5</td>
  </tr>
  <tr>
  <td>X</td>
  <td>product3</td>
  <td>3</td>
  </tr>
  </tbody>
  </table>
  </div>
  <p>I want result to be 12 (so we use Sales for product1 only once)
  I tried to do something like this but it will take only 5 or 4 (depends on MAX, MIN functions) for Group Y.</p>
  <pre><code>= SUMX(
            DISTINCT(
                       Table[product1]
             ),
             MAXX(DISTINCT(Table[product1]), MAX(Table[Sales]))
  )
  </code></pre>
  <p>Please help me, haven't found any solutions yet :(</p>