Forum Discussion

tbobolz's avatar
tbobolz
Resolver I
7 years ago
Solved

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...
  • jmalone's avatar
    jmalone
    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" }
            )
        )
    )