title: DAX measure that returns the distinct number of values that have duplicates within the table
body: <p>Fairly new and self-taught with DAX. I run an accuracy log that tracks incoming applications (Application[Application_ID]) and errors committed in processing that application (Error_Log[Application_ID]). </p>
  
  <p>I want to find the number of applications that contain more than one error. For example, if 10 applications have errors, 6 of those applications have 1 error and the rest have 2 or more errors, I want to return the value of 4. </p>
  
  <p>I'm trying to avoid a calculated column (like a "Multiple_Errors" TRUE/FALSE column) as it's refresh times are already longer than I'd like, but if it's unavoidable, it could be accommodated. </p>
  
  <p>We were able to build an Excel formula with SUMPRODUCT for a very high level summary of the information, but I want more granularity than that formula can give me. </p>
  
  <p>The online search has only led to finding articles on how to count the number of duplicates, flag the duplicates, remove duplicates or some other task, where I need to count a distinct number of values that have been duplicated within a table.</p>
  
  <p>I have tried a few different DAX measures, but all of them have yielded incorrect results. For example...</p>
  
  <pre><code>    =
  CALCULATE (
      DISTINCTCOUNT ( Error_Log[Appplication_ID] ),
      FILTER ( Error_Log, COUNTA ( Error_Log[Appplication_ID] ) &gt; 1 )
  )
  </code></pre>
  
  <p>Drilling down into this result shows that all of the applications with errors are being pulled over, rather than only those with greater than one error.</p>
  
  <p>After playing with a few options, I haven't been able to find the solution. Any help/pointers/direction would be greatly appreciated!</p>