<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Using CONTAINSSTRING function inside CALCULATETABLE to filter partial string matches to multiple str in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-CONTAINSSTRING-function-inside-CALCULATETABLE-to-filter/m-p/3210489#M117076</link>
    <description>&lt;LI-CODE lang="markup"&gt;table =
DATATABLE (
    "Name", STRING,
    "Code", STRING,
    "ID", INTEGER,
    {
        { "asldkjfaaa", "ABC", 1 },
        { "jdfkbbb", "ABC", 2 },
        { "dskhgaaa", "XYZ", 3 },
        { "hfdjk", "ABC", 4 },
        { "eowyyui", "ABC", 5 }
    }
)

filter =
CALCULATETABLE (
    'table',
    'table'[Code] = "ABC",
    FILTER ( 'table', NOT ( CONTAINSSTRING ( 'table'[Name], "aaa" ) ) )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using powerbi and I am selecting the New table button first to create the data and second to filter the data. What I am tripping over is the fact that CONTAINSSTRING only accepts two arguments and the second argument has to be a string rather than the option of multiple strings. Moreover I cannot repeat the function argument line in the CALCULATETABLE list of filters. The only solution I have now is to wrap the entire code block inside a FILTER argument for each partial string match I want to exclude. I am wondering if there is something better&lt;/P&gt;</description>
    <pubDate>Fri, 28 Apr 2023 03:44:51 GMT</pubDate>
    <dc:creator>sumant28</dc:creator>
    <dc:date>2023-04-28T03:44:51Z</dc:date>
    <item>
      <title>Using CONTAINSSTRING function inside CALCULATETABLE to filter partial string matches to multiple str</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-CONTAINSSTRING-function-inside-CALCULATETABLE-to-filter/m-p/3210489#M117076</link>
      <description>&lt;LI-CODE lang="markup"&gt;table =
DATATABLE (
    "Name", STRING,
    "Code", STRING,
    "ID", INTEGER,
    {
        { "asldkjfaaa", "ABC", 1 },
        { "jdfkbbb", "ABC", 2 },
        { "dskhgaaa", "XYZ", 3 },
        { "hfdjk", "ABC", 4 },
        { "eowyyui", "ABC", 5 }
    }
)

filter =
CALCULATETABLE (
    'table',
    'table'[Code] = "ABC",
    FILTER ( 'table', NOT ( CONTAINSSTRING ( 'table'[Name], "aaa" ) ) )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using powerbi and I am selecting the New table button first to create the data and second to filter the data. What I am tripping over is the fact that CONTAINSSTRING only accepts two arguments and the second argument has to be a string rather than the option of multiple strings. Moreover I cannot repeat the function argument line in the CALCULATETABLE list of filters. The only solution I have now is to wrap the entire code block inside a FILTER argument for each partial string match I want to exclude. I am wondering if there is something better&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 03:44:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-CONTAINSSTRING-function-inside-CALCULATETABLE-to-filter/m-p/3210489#M117076</guid>
      <dc:creator>sumant28</dc:creator>
      <dc:date>2023-04-28T03:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Using CONTAINSSTRING function inside CALCULATETABLE to filter partial string matches to multiple str</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-CONTAINSSTRING-function-inside-CALCULATETABLE-to-filter/m-p/3210495#M117077</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="552798" data-lia-user-login="sumant28" class="lia-mention lia-mention-user"&gt;sumant28&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you can do&lt;/P&gt;
&lt;P&gt;filter =&lt;BR /&gt;CALCULATETABLE (&lt;BR /&gt;'table',&lt;BR /&gt;'table'[Code] = "ABC",&lt;BR /&gt;NOT ( CONTAINSSTRING ( 'table'[Name], "aaa" ) )&lt;BR /&gt;)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;filter =&lt;BR /&gt;FILTER (&lt;BR /&gt;'table',&lt;BR /&gt;'table'[Code] = "ABC"&lt;BR /&gt;&amp;amp;&amp;amp; NOT ( CONTAINSSTRING ( 'table'[Name], "aaa" ) )&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 03:54:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-CONTAINSSTRING-function-inside-CALCULATETABLE-to-filter/m-p/3210495#M117077</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-28T03:54:50Z</dc:date>
    </item>
    <item>
      <title>Re: Using CONTAINSSTRING function inside CALCULATETABLE to filter partial string matches to multiple str</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-CONTAINSSTRING-function-inside-CALCULATETABLE-to-filter/m-p/3210516#M117078</link>
      <description>&lt;P&gt;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&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FILTER(FILTER(FILTER....&lt;/LI-CODE&gt;&lt;P&gt;But I am not satisfied with how that solution looks&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 04:09:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-CONTAINSSTRING-function-inside-CALCULATETABLE-to-filter/m-p/3210516#M117078</guid>
      <dc:creator>sumant28</dc:creator>
      <dc:date>2023-04-28T04:09:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using CONTAINSSTRING function inside CALCULATETABLE to filter partial string matches to multiple str</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-CONTAINSSTRING-function-inside-CALCULATETABLE-to-filter/m-p/3210552#M117079</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="552798" data-lia-user-login="sumant28" class="lia-mention lia-mention-user"&gt;sumant28&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Definitely you need to iterate ove that list but that is fine, ot is just a small list of 6 rows. For sure there will be room for optimization but you need to be specific about what exactly are you trying to accomplish.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2023 05:01:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-CONTAINSSTRING-function-inside-CALCULATETABLE-to-filter/m-p/3210552#M117079</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2023-04-28T05:01:11Z</dc:date>
    </item>
  </channel>
</rss>

