Forum Discussion
tbobolz
Resolver I
7 years agoHow to calculate unique count based on multiple column values
Hi All, I'm struggling to figure out a DAX formula to count the "unique" account numbers in the below example if a select set of DRG and/or ICD10 values match in the related columns of each account n...
- 7 years ago
You might try adding a FILTER function to your measure. The concept is the same, but the syntax should allow multiple columns in the condition.
Test 2 = CALCULATE ( DISTINCTCOUNT ( sj_strata_encounter_hb[FINNBR] ), FILTER ( sj_strata_encounter_hb, OR ( sj_strata_encounter_hb[MS DRG CODE] IN { "10", "266", "621" }, sj_strata_encounter_hb[ADMIT ICD10 DX CODE] IN { "S48.23", "C24", "P12" } ) ) )
jtownsend21
Responsive Resident
7 years agoWas the issue the quotations on the DRG values in the function?
tbobolz
Resolver I
7 years agoYes sir, DRG is in whole number format, while ICD10 is text! A simple mistake, even for me!
Thanks you two, my kids might see me tonight after all.