Forum Discussion
sumant28
3 years agoNew Member
Using CONTAINSSTRING function inside CALCULATETABLE to filter partial string matches to multiple str
table =
DATATABLE (
"Name", STRING,
"Code", STRING,
"ID", INTEGER,
{
{ "asldkjfaaa", "ABC", 1 },
{ "jdfkbbb", "ABC", 2 },
{ "dskhgaaa", "XYZ", 3 },
{ ...
tamerj1
3 years agoCommunity Champion
Hi sumant28
you can do
filter =
CALCULATETABLE (
'table',
'table'[Code] = "ABC",
NOT ( CONTAINSSTRING ( 'table'[Name], "aaa" ) )
)
or
filter =
FILTER (
'table',
'table'[Code] = "ABC"
&& NOT ( CONTAINSSTRING ( 'table'[Name], "aaa" ) )
)
sumant28
3 years agoNew Member
I forgot to mention in my original post that I don't just want to filter out a partial match to "aaa" but also to "bbb" and so on. My actual problem includes a list of about six such strings. I can have my query take the form of something like
FILTER(FILTER(FILTER....But I am not satisfied with how that solution looks