Forum Discussion
tbobolz
7 years agoResolver I
How 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
7 years agoResponsive Resident
Was the issue the quotations on the DRG values in the function?
tbobolz
7 years agoResolver I
Yes 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.