title: Trying to sum distinct values SQL
body: <p>I'm having trouble coming up with a value for a cell in SSRS, which should be a sum of distinct values. I have a SSRS report that looks similar to the below screenshot:</p>
  
  <p><img src="https://i.stack.imgur.com/pn9A2.jpg" alt="enter image description here"></p>
  
  <p>I'm having trouble getting the value in red ($11.25). I basically need to sum the Ship Cost, based on distinct Tracking #s. So there are two distinct tracking #s, one with a Ship Cost of $5.25 and the other $6.00, so the total displayed in red should be $11.25. But I cannot achieve this in SSRS and can't figure it out in the SQL query either.</p>
  
  <p>I'm thinking a subquery like (and I know the below is not valid SQL):</p>
  
  <pre><code>(SELECT SUM([Ship Cost]) WHERE [Tracking #] IS DISTINCT) AS [Ship Cost]
  </code></pre>
  
  <p>But I don't know how to write it.</p>