Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello All,
I have the following table:
| Name | Value |
| CocaLight | 5 |
| CocaZero | 6 |
| Zero | 3 |
| Extra | 1 |
| PesMax | 2 |
I want to calculate the sum of the values but exlude all the name containing "Coca" in its name.
What would be the formula ?
Thanks
Solved! Go to Solution.
Hey @Chrisjr,
You can use the CONTAINSTRING function in combination with a CALCULATE for this. SUM the 'Value' column, where the 'Name' does not contain the value 'Coca':
Formula =
CALCULATE (
SUM ( 'Table'[Value] ),
KEEPFILTERS ( NOT CONTAINSSTRING ( 'Table'[Name], "Coca" ) )
)
If you need 'Coca' to be case sensitive, use the CONTAINTSSTRINGEXACT function instead of CONTAINSSTRING.
Hey @Chrisjr,
You can use the CONTAINSTRING function in combination with a CALCULATE for this. SUM the 'Value' column, where the 'Name' does not contain the value 'Coca':
Formula =
CALCULATE (
SUM ( 'Table'[Value] ),
KEEPFILTERS ( NOT CONTAINSSTRING ( 'Table'[Name], "Coca" ) )
)
If you need 'Coca' to be case sensitive, use the CONTAINTSSTRINGEXACT function instead of CONTAINSSTRING.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 93 | |
| 81 | |
| 73 | |
| 46 | |
| 35 |