BCVA
BCVA

Reputation: 11

Count Distinct with Multiple Conditions

I am trying to do a DISTINCTCOUNT of customer IDs after the following filters are applied:

1) [type_] = "Subscription" 

2) [state_] = "Active" 

3) [archivedAt] = Blank())

How can I change the below to not use "Filter" because it says I'm using it too many times.

Too many arguments were passed to the FILTER function. The maximum argument count for the function is 2.

Thanks!

Upvotes: 1

Views: 8713

Answers (1)

Deltapimol
Deltapimol

Reputation: 176

You should try using CALCULATE instead of using FILTER. Calculate can handle multiple filters in it.

 YourMeasure =
CALCULATE (
    DISTINCTCOUNT ( Table[Customer ID] ),
    [type_] = "Subscription",
    [state_] = "Active",
    [archivedAt] = BLANK ()
)

https://learn.microsoft.com/en-us/dax/calculate-function-dax

Upvotes: 1

Related Questions