Forum Discussion
Calculated field with filter excluding specificrecords
Hello,
I am trying to modify a calculated field and add a filter that will exclude certain opportunity numbers from the summation.
The formula works without the last filter, but I need to exclude certain records from the reporting.
Any help would be grealy appreciated!
Thanks,
Greg
CY # SQO (All) =
CALCULATE (
COUNT ( 'Marketing Snapshot'[SQODate] ),
FILTER (
ALL ( 'Marketing Snapshot'[SQOYear] ),
'Marketing Snapshot'[SQOYear] = [Max SQO Year]
),
FILTER (
ALL ( 'Marketing Snapshot'[DateStampMonth] ),
'Marketing Snapshot'[DateStampMonth] = [Max DateStampMonth]
),
FILTER (
ALL ( 'Marketing Snapshot'[OpportunityNumber] ),
'Marketing Snapshot'[OpportunityNumber] NOT IN {"O751700","O761393"})
Hi gsed99
The negation of
<X> IN <Y>
is
NOT <X> IN <Y>
Also, since your 3rd filter argument within CALCULATE doesn't reference any measures etc, you can get rid of FILTER (ALL(...)) and get the same result.
This expression should work:
CY # SQO (All) = CALCULATE ( COUNT ( 'Marketing Snapshot'[SQODate] ), FILTER ( ALL ( 'Marketing Snapshot'[SQOYear] ), 'Marketing Snapshot'[SQOYear] = [Max SQO Year] ), FILTER ( ALL ( 'Marketing Snapshot'[DateStampMonth] ), 'Marketing Snapshot'[DateStampMonth] = [Max DateStampMonth] ), NOT 'Marketing Snapshot'[OpportunityNumber] IN { "O751700", "O761393" } )Regards,
Owen
4 Replies
- OwenAuger
Super User
Hi gsed99
The negation of
<X> IN <Y>
is
NOT <X> IN <Y>
Also, since your 3rd filter argument within CALCULATE doesn't reference any measures etc, you can get rid of FILTER (ALL(...)) and get the same result.
This expression should work:
CY # SQO (All) = CALCULATE ( COUNT ( 'Marketing Snapshot'[SQODate] ), FILTER ( ALL ( 'Marketing Snapshot'[SQOYear] ), 'Marketing Snapshot'[SQOYear] = [Max SQO Year] ), FILTER ( ALL ( 'Marketing Snapshot'[DateStampMonth] ), 'Marketing Snapshot'[DateStampMonth] = [Max DateStampMonth] ), NOT 'Marketing Snapshot'[OpportunityNumber] IN { "O751700", "O761393" } )Regards,
Owen