Forum Discussion

jonnyA's avatar
jonnyA
Icon for Responsive Resident rankResponsive Resident
5 years ago
Solved

My Countdistinct Total is not summing correctly

Im using countdistinct for "Patients seen", however, the total is not summing correctly.  See pic.  Can any one help?  
  • jdbuchanan71's avatar
    jdbuchanan71
    5 years ago

    OK, you should avoid implicit measures, this is a measure where you drag a field from a table into a view then pick "Summarize By": Count.  Instead you want to write a measure that does what you want, that way you can use it other places.

    So, New Measure.

     

    Patient Count = DISTINCTCOUNT ( vw_???_DocAudit[PatientName] )

     

    Then we make the next one that sums correctly.

     

    Patient Count Totaling = SUMX ( VALUES ( vw_???_DocAudit[ProcedureCode] ), [Patient Count] )

     

    The second measure uses the first one we made.

    You should end up with something like this (we call them claimants rather than patients):