<?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: seaching for keywords in text for use as index seach function in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/seaching-for-keywords-in-text-for-use-as-index-seach-function/m-p/1153592#M17596</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DAX to create an index column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Id_Dax = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RANKX(ALL(Words[Category]),CONCATENATE(Words[Category],""))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Harsh Nathani&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Thu, 11 Jun 2020 16:33:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-06-11T16:33:23Z</dc:date>
    <item>
      <title>seaching for keywords in text for use as index seach function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/seaching-for-keywords-in-text-for-use-as-index-seach-function/m-p/1152135#M17551</link>
      <description>&lt;P&gt;I have a text string containing key words that I want to index so I can filter based on these words. The below measure, however, duplicates the Category if keys are included multiple times, for instance if both cod and herring is in the same text string&amp;nbsp;it gives “FishFish” rather than Fish. I would also like to have a delimiter between multiple words such as “Animal, Insect”.&amp;nbsp; Any tips?&lt;/P&gt;&lt;P&gt;Key's and their Category;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Category&lt;/TD&gt;&lt;TD&gt;key&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Animal&lt;/TD&gt;&lt;TD&gt;dog&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Animal&lt;/TD&gt;&lt;TD&gt;cat&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fish&lt;/TD&gt;&lt;TD&gt;cod&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fish&lt;/TD&gt;&lt;TD&gt;herring&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Insect&lt;/TD&gt;&lt;TD&gt;wasp&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Text with the added column and measure filter1 shown below.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Text&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;filter1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Dogs don't eat cod&lt;/TD&gt;&lt;TD&gt;AnimalFish&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;In cat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;Animal&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fishing for Herring and cod&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;FishFish&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;No wasp stings dogs&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;AnimalInsect&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Raining cats and dogs but not cod&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;AnimalAnimalFish&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Wasping the herrings in the codcat&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;AnimalFishFishInsect&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;filter1 = var result=
CONCATENATEX(
    'Key',
    if(
        Search(FIRSTNONBLANK('Key'[key],1),Text1[Text],,999)&amp;lt;&amp;gt; 999,
        'Key'[Category],""
    
    )
)
Return
if(
    result&amp;lt;&amp;gt;bLANK(),
    result,
    "-"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 06:50:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/seaching-for-keywords-in-text-for-use-as-index-seach-function/m-p/1152135#M17551</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-11T06:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: seaching for keywords in text for use as index seach function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/seaching-for-keywords-in-text-for-use-as-index-seach-function/m-p/1152969#M17561</link>
      <description>&lt;P&gt;The delimiter is the easy part&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;filter1 = var result=
CONCATENATEX(
    'Key',
    if(
        Search('Key'[key],Text1[Text],,999)&amp;lt;&amp;gt; 999,
        'Key'[Category] &amp;amp; ","
    
    )
)
Return
if(
    result&amp;lt;&amp;gt;bLANK(),
    left(result,len(result)-1),
    "-"
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;But the repetitions are more tricky.&amp;nbsp; One question - can you guarantee that the Key table is sorted alphabetically by Category?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 12:05:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/seaching-for-keywords-in-text-for-use-as-index-seach-function/m-p/1152969#M17561</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-11T12:05:33Z</dc:date>
    </item>
    <item>
      <title>Re: seaching for keywords in text for use as index seach function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/seaching-for-keywords-in-text-for-use-as-index-seach-function/m-p/1153207#M17571</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Text Data is the table which contains your text.&lt;/P&gt;&lt;P&gt;Words table is which contains your Category and Key&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You will need to create an id for your category in Power Query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1. Group your Word Table by Category.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create an&amp;nbsp; Index Column from Add Columns. Start with Index 1.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expand the key Column only&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create a Calculated Column&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Found = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var a = filter(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;all('Words'[key]),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;search('Words'[key],TextData[Text ],1,0)&amp;lt;&amp;gt;0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;calculate(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CONCATENATEX(values('Words'[Category]),Words[Category],","),a)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Harsh Nathani&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 13:53:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/seaching-for-keywords-in-text-for-use-as-index-seach-function/m-p/1153207#M17571</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-11T13:53:18Z</dc:date>
    </item>
    <item>
      <title>Re: seaching for keywords in text for use as index seach function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/seaching-for-keywords-in-text-for-use-as-index-seach-function/m-p/1153265#M17576</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp; great approach. But it's cheating &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&amp;nbsp; Any way to do that indexing in DAX?&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 14:22:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/seaching-for-keywords-in-text-for-use-as-index-seach-function/m-p/1153265#M17576</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-11T14:22:45Z</dc:date>
    </item>
    <item>
      <title>Re: seaching for keywords in text for use as index seach function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/seaching-for-keywords-in-text-for-use-as-index-seach-function/m-p/1153344#M17582</link>
      <description>&lt;P&gt;Thanks alot, this works perfectly!&lt;/P&gt;</description>
      <pubDate>Thu, 11 Jun 2020 14:58:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/seaching-for-keywords-in-text-for-use-as-index-seach-function/m-p/1153344#M17582</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-11T14:58:45Z</dc:date>
    </item>
    <item>
      <title>Re: seaching for keywords in text for use as index seach function</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/seaching-for-keywords-in-text-for-use-as-index-seach-function/m-p/1153592#M17596</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;DAX to create an index column&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Id_Dax = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RANKX(ALL(Words[Category]),CONCATENATE(Words[Category],""))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Regards,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Harsh Nathani&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 11 Jun 2020 16:33:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/seaching-for-keywords-in-text-for-use-as-index-seach-function/m-p/1153592#M17596</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-11T16:33:23Z</dc:date>
    </item>
  </channel>
</rss>

