Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
120 | |
101 | |
71 | |
61 |