Forum Discussion
My Countdistinct Total is not summing correctly
- 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):
That just means that some of the patients in the 8516 are also in the 6001 for example and then when you look at in total those people only get counted once.
The total row has not concept of the numbers above it. It calculates the DISTINCTCOUNT with no category filter applied (whatever you have in the first column that is splitting up the number).
jdbuchanan71 , Ok, i see what you are saying, however, shouldn't there be a way for that total to sum correctly?
- jdbuchanan715 years ago
Super User
There is, you would use something like this.
Patients Seen Sum = SUMX ( values ( whatever your category column is here ), [Patients Seen] )