Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi,
I'm trying to implement a measure with NOT(CONSTAINSSTRING) with 2 values, as in the following example:
The first NOT(CONTAINS) filter is working but the second one is being ignored.
Any idea what's wrong with this measure?
Thx in advance! 🙂
Solved! Go to Solution.
I think you might have the nesting wrong. What you currently have is
Test =
CALCULATE (
SUM ( 'GA, FB, Spend'[spend] ),
'GA, FB, Spend'[account_name] = "DE",
CONTAINSSTRING ( 'GA, FB, Spend'[campaign], "Gemischt*" ),
NOT (
CONTAINSSTRING ( 'GA, FB, Spend'[ad_group_name], "PR01*" )
&& NOT ( CONTAINSSTRING ( 'GA, FB, Spend'[ad_group_name], "PR02*" ) )
)
)
If you're trying to exclude both PR01 and PR02 try
Test =
CALCULATE (
SUM ( 'GA, FB, Spend'[spend] ),
'GA, FB, Spend'[account_name] = "DE",
CONTAINSSTRING ( 'GA, FB, Spend'[campaign], "Gemischt*" ),
NOT CONTAINSSTRING ( 'GA, FB, Spend'[ad_group_name], "PR01*" )
&& NOT CONTAINSSTRING ( 'GA, FB, Spend'[ad_group_name], "PR02*" )
)
I think you might have the nesting wrong. What you currently have is
Test =
CALCULATE (
SUM ( 'GA, FB, Spend'[spend] ),
'GA, FB, Spend'[account_name] = "DE",
CONTAINSSTRING ( 'GA, FB, Spend'[campaign], "Gemischt*" ),
NOT (
CONTAINSSTRING ( 'GA, FB, Spend'[ad_group_name], "PR01*" )
&& NOT ( CONTAINSSTRING ( 'GA, FB, Spend'[ad_group_name], "PR02*" ) )
)
)
If you're trying to exclude both PR01 and PR02 try
Test =
CALCULATE (
SUM ( 'GA, FB, Spend'[spend] ),
'GA, FB, Spend'[account_name] = "DE",
CONTAINSSTRING ( 'GA, FB, Spend'[campaign], "Gemischt*" ),
NOT CONTAINSSTRING ( 'GA, FB, Spend'[ad_group_name], "PR01*" )
&& NOT CONTAINSSTRING ( 'GA, FB, Spend'[ad_group_name], "PR02*" )
)
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 9 | |
| 5 | |
| 4 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 10 | |
| 10 | |
| 8 |