Forum Discussion
Sum columns filtering table on multiple containsstring values
- 3 years ago
Hi NMOORE
Check this measure:
AA = SUMX ( FILTER ( 'Table', CONTAINSSTRING ( 'Table'[CBS Code], "1.2.4" ) && LEFT ( 'Table'[CBS Name], 4 ) IN { "NOP1", "NOP2", "NOP3" } ), [Budget] )If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Hi NMOORE
Check this measure:
AA =
SUMX (
FILTER (
'Table',
CONTAINSSTRING ( 'Table'[CBS Code], "1.2.4" )
&& LEFT ( 'Table'[CBS Name], 4 ) IN { "NOP1", "NOP2", "NOP3" }
),
[Budget]
)
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Thank you very much, I will accept as solution (but wasn't sure if that will close this case!?) but either way I just wanted to ask one more question.
Can it just use the IN function to search anywhere in the CBS Name for NOP1 NOP2 NOP3, rather than search the first 4 left characters, as I can't guarantee they will always be there. I tried to remove the LEFT part but it didn’t like it.
Thanks again
- VahidDM3 years ago
Super User
Yes, If my solution works, it would be better accepte it as the solution to help the other members find it more quickly and close the case.
You can change that to CONTAINSSTRING with some OR to cover those 3 conditions.If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn | Twitter | Blog | YouTube