title: Tableau calculated field distinct sum of metric base on selected dimensions
body: <p>I have this table imported to tableau and face a challenge in aggregating it correctly in the calculated field. I want to sum base_count but don't want to sum the duplicate base_count. </p>
  
  <p>I only want to <strong>sum distinct base_count by date and problem</strong></p>
  
  <p><a href="https://i.stack.imgur.com/imZrE.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/imZrE.png" alt="enter image description here"></a></p>
  
  <p>I want the chart result to look like this, which in sql is</p>
  
  <pre><code>select date, problem, sum(count), sum(distinct base_count) as base_count
  from table
  group by date,problem
  </code></pre>
  
  <p><a href="https://i.stack.imgur.com/JkNtv.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/JkNtv.png" alt="enter image description here"></a></p>
  
  <p>I tried exclude,include, fixed level of detail expressions, I am a beginner in tableau. Anyone better idea what functions to use to count the distinct <strong>base_count</strong> <strong>by date by problem dimensions</strong>? </p>