Forum Discussion

adavid999's avatar
adavid999
Helper V
5 years ago
Solved

dax filtering

Hello, please can someone explain why these two measures produce different results (something to do with the AND/OR but I don't understand why these would differ)? (I am reposting this as I made an e...
  • AlexisOlson's avatar
    5 years ago

    Suppose you have type 2 and color 4. Then measure 1 would count it but not measure 2.

     

    Note that your logical combination

    T1 || T2 || T3 && C5 || C6 || C7 || C8

    is equivalent to

    T1 || T2 || (T3 && C5) || C6 || C7 || C8

    not as I think you intended

    (T1 || T2 || T3) && (C5 || C6 || C7 || C8)

     

    I'd rewrite the measure as

     

    check (no.) =
    CALCULATE (
        COUNT ( fct_core[colour] ),
        fct_core[type] IN { 1, 2, 3 },
        fct_core[colour] IN { 5, 6, 7, 8 }
    )