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):
jdbuchanan71 I tried your suggestions, however, the total sum is still incorrect.
That is not enough information for me to help you. You need to show me the measures you have used and the category of data you are trying to slice it up by.
- jonnyA5 years ago
Responsive Resident
Ok, so I am using the following ...
Procedure Code ... 99281 through 99292
PatientName ... Count(Distinct)
PatientName ... Count(Distinct) shown as Percent of Grand Total
For now, ignore the calculated measures I created for this dataset.
I have 2 issues outstanding that I cannot figure out ...
1. I'd prefer the "Count of PatientName" column to sum correctly. Should be 18,745, not 15,465.
2. The "%GT Count of PatientName" is not summing correctly either. If you add up those %'s you'll get 121.20% I would think those %'s should add up to 100%?
Thank you for your help already and I appreciate help going forward too, greatly appreciated!!!
- jdbuchanan715 years ago
Super User
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):
- jonnyA5 years ago
Responsive Resident
Wow, that was awesome!!! Thank you so much!!!
And if anyone else wants to know, I had this question i postyed earlier ... 2. The "%GT Count of PatientName" is not summing correctly either. If you add up those %'s you'll get 121.20% I would think those %'s should add up to 100%? Solution for that is to use the measure I just created ... Patient Count Totaling = SUMX ( VALUES ( vw_???_DocAudit[ProcedureCode] ), [Patient Count] ) ... and then, SHOW VALUE AS ... % of Grand total.
Thanks again for the help, so pumped!!!