Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
105 | |
97 | |
75 | |
63 | |
62 |
User | Count |
---|---|
137 | |
105 | |
104 | |
80 | |
63 |