<?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 Re: Search a substring in string from another table with DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Search-a-substring-in-string-from-another-table-with-DAX/m-p/3230421#M118510</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try this solution:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, you may not like some of its drawbacks:&lt;/P&gt;&lt;P&gt;- sorting in Products IDs may not match sorting in Description;&lt;/P&gt;&lt;P&gt;- if you have duplicates in Products IDs, they will have only one match in Description.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If those things don't bother you, it should be fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the same calculated column in the text format:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Description = 
CONCATENATEX ( FILTER ( ADDCOLUMNS ( Table2,                
                                     "Presence", 
                                     CONTAINSSTRING ( [Products IDs], [Product ID] ) ), 
                        [Presence] = TRUE () ), 
               [Description], 
               ";" )&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Best Regards, &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Alexander&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@powerbi-vlog" target="_blank"&gt;My YouTube vlog in English&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@pbi-vlog" target="_blank"&gt;My YouTube vlog in Russian&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 11 May 2023 09:18:59 GMT</pubDate>
    <dc:creator>barritown</dc:creator>
    <dc:date>2023-05-11T09:18:59Z</dc:date>
    <item>
      <title>Search a substring in string from another table with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Search-a-substring-in-string-from-another-table-with-DAX/m-p/3228859#M118395</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need help figuring out how to search for a substring in another table with DAX. My data looks like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 1:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Customer ID&lt;/TD&gt;&lt;TD&gt;Products IDs&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AA_019442&lt;/TD&gt;&lt;TD&gt;123456A;123456B&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BB_149432&lt;/TD&gt;&lt;TD&gt;123456A&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CC_924742&lt;/TD&gt;&lt;TD&gt;123456F;123456C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;DD_127194&lt;/TD&gt;&lt;TD&gt;123456C&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EE_373878&lt;/TD&gt;&lt;TD&gt;123456E&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Table 2 (unrelated and unique ids):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Product ID&lt;/TD&gt;&lt;TD&gt;Description&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;123456A&lt;/TD&gt;&lt;TD&gt;AAAAAAAAAAA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;123456B&lt;/TD&gt;&lt;TD&gt;BBBBBBBBBBBBB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;123456C&lt;/TD&gt;&lt;TD&gt;CCCCCCCCCCCC&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to compare every substring in the column "Product IDs" in Table 1 with the column "Product ID" in Table 2.&lt;/P&gt;&lt;P&gt;My expected outcome would be:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;If both subtrings match, then I should get the description concatenated&lt;/LI&gt;&lt;LI&gt;If just one of the substrings match, then I should get only the description for the ids that math&lt;/LI&gt;&lt;LI&gt;If there is no match, then BLANK&lt;/LI&gt;&lt;/UL&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Customer ID&lt;/TD&gt;&lt;TD&gt;Product IDs&lt;/TD&gt;&lt;TD&gt;Description&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;AA_019442&lt;/TD&gt;&lt;TD&gt;123456A;123456B&lt;/TD&gt;&lt;TD&gt;AAAAAAAAAAA;BBBBBBBBBBBBB&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;BB_149432&lt;/TD&gt;&lt;TD&gt;123456A&lt;/TD&gt;&lt;TD&gt;AAAAAAAAAAA&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;CC_924742&lt;/TD&gt;&lt;TD&gt;123456F;123456C&lt;/TD&gt;&lt;TD&gt;CCCCCCCCCCCC&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;DD_127194&lt;/TD&gt;&lt;TD&gt;123456C&lt;/TD&gt;&lt;TD&gt;CCCCCCCCCCCC&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;EE_373878&lt;/TD&gt;&lt;TD&gt;123456E&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I know that this could easily be accomplished with PowerQuery/M by splitting every product IDs by the delimiter ";" and matching them, but I'm asking for help with DAX because of how the PowerBI model has been made.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I thought at first the SEARCH function or the CONTAINSSTRING one would work, but I didn't manage to write the code for it, because I don't know how to search for contents in another unrelated table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks everyone in advance!!&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 13:26:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Search-a-substring-in-string-from-another-table-with-DAX/m-p/3228859#M118395</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-05-10T13:26:29Z</dc:date>
    </item>
    <item>
      <title>Re: Search a substring in string from another table with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Search-a-substring-in-string-from-another-table-with-DAX/m-p/3230421#M118510</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can try this solution:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, you may not like some of its drawbacks:&lt;/P&gt;&lt;P&gt;- sorting in Products IDs may not match sorting in Description;&lt;/P&gt;&lt;P&gt;- if you have duplicates in Products IDs, they will have only one match in Description.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If those things don't bother you, it should be fine.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the same calculated column in the text format:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Description = 
CONCATENATEX ( FILTER ( ADDCOLUMNS ( Table2,                
                                     "Presence", 
                                     CONTAINSSTRING ( [Products IDs], [Product ID] ) ), 
                        [Presence] = TRUE () ), 
               [Description], 
               ";" )&lt;/LI-CODE&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Best Regards, &lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;Alexander&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@powerbi-vlog" target="_blank"&gt;My YouTube vlog in English&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="2"&gt;&lt;A href="https://youtube.com/@pbi-vlog" target="_blank"&gt;My YouTube vlog in Russian&lt;/A&gt;&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 09:18:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Search-a-substring-in-string-from-another-table-with-DAX/m-p/3230421#M118510</guid>
      <dc:creator>barritown</dc:creator>
      <dc:date>2023-05-11T09:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: Search a substring in string from another table with DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Search-a-substring-in-string-from-another-table-with-DAX/m-p/4629418#M177228</link>
      <description>&lt;P&gt;Barritown,&lt;/P&gt;&lt;P&gt;Thanks for this tip it is very usefull but I have a question. I have a situation where I want the result to be the sum of the the values rather than concatenate them. Is that possible?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 28 Mar 2025 14:09:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Search-a-substring-in-string-from-another-table-with-DAX/m-p/4629418#M177228</guid>
      <dc:creator>MagnumUser</dc:creator>
      <dc:date>2025-03-28T14:09:21Z</dc:date>
    </item>
  </channel>
</rss>

