Forum Discussion

KMZ_ESS's avatar
KMZ_ESS
Helper I
3 years ago
Solved

Measure with multiple filters on same field

Dear all,   I'm trying to create a measure to show the number of accounts that have the following attributes: - Status: active - Relationship Type: Customer, (blank), Non Buying Entity   I used...
  • johnt75's avatar
    johnt75
    3 years ago

    FILTER can handle multiple conditions as long as they are on the same table, you just need to join them with && for and and || for or conditions.

    If you are using them inside a CALCULATE statement then you don't need to explicitly specify FILTER, you can pass in as many filter conditions as you like and they can be across multiple tables.

    For the relative date filter, if you have a proper date table set up you could use something like

    Within last 3 months =
    VAR StartDate =
        EOMONTH ( TODAY (), -4 ) + 1
    RETURN
        CALCULATE ( [My measure], DATESBETWEEN ( 'Date'[Date], StartDate, TODAY () ) )