<?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 Categorizing a Narrative based on keywords in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorizing-a-Narrative-based-on-keywords/m-p/3102499#M109148</link>
    <description>&lt;P&gt;I have a Table containing a Narrative field. I have another table (Categories) with Keyword - Category pairs. I want to add a measure into Table that will search for Keword in Narrative and returns the first corresponding Category it finds. I thought the following could do it&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;LI-CODE lang="markup"&gt;Category = 
VAR NarrativeText = Table[Narrative]
RETURN
    MAXX(
        FILTER(
            Categories,
            CONTAINSSTRING(NarrativeText, Categories[Keyword])
        ),
        Categories[Category]
    )&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;but it returns the following error: "A single value for column 'Narrative' in table 'Table' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."&lt;/P&gt;&lt;P&gt;Can I correct the formula or is there a better way to do this?&lt;/P&gt;</description>
    <pubDate>Mon, 27 Feb 2023 22:53:37 GMT</pubDate>
    <dc:creator>PetrM</dc:creator>
    <dc:date>2023-02-27T22:53:37Z</dc:date>
    <item>
      <title>Categorizing a Narrative based on keywords</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorizing-a-Narrative-based-on-keywords/m-p/3102499#M109148</link>
      <description>&lt;P&gt;I have a Table containing a Narrative field. I have another table (Categories) with Keyword - Category pairs. I want to add a measure into Table that will search for Keword in Narrative and returns the first corresponding Category it finds. I thought the following could do it&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;LI-CODE lang="markup"&gt;Category = 
VAR NarrativeText = Table[Narrative]
RETURN
    MAXX(
        FILTER(
            Categories,
            CONTAINSSTRING(NarrativeText, Categories[Keyword])
        ),
        Categories[Category]
    )&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;but it returns the following error: "A single value for column 'Narrative' in table 'Table' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."&lt;/P&gt;&lt;P&gt;Can I correct the formula or is there a better way to do this?&lt;/P&gt;</description>
      <pubDate>Mon, 27 Feb 2023 22:53:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorizing-a-Narrative-based-on-keywords/m-p/3102499#M109148</guid>
      <dc:creator>PetrM</dc:creator>
      <dc:date>2023-02-27T22:53:37Z</dc:date>
    </item>
    <item>
      <title>Re: Categorizing a Narrative based on keywords</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorizing-a-Narrative-based-on-keywords/m-p/3102729#M109160</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="450571" data-lia-user-login="PetrM" class="lia-mention lia-mention-user"&gt;PetrM&lt;/a&gt; , You have to create this as a column; the above formula&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;or a measure like&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Category = &lt;BR /&gt;VAR NarrativeText = max(Table[Narrative])&lt;BR /&gt;RETURN&lt;BR /&gt;MAXX(&lt;BR /&gt;FILTER(&lt;BR /&gt;Categories,&lt;BR /&gt;CONTAINSSTRING(NarrativeText, Categories[Keyword])&lt;BR /&gt;),&lt;BR /&gt;Categories[Category]&lt;BR /&gt;)&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 02:30:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorizing-a-Narrative-based-on-keywords/m-p/3102729#M109160</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2023-02-28T02:30:24Z</dc:date>
    </item>
    <item>
      <title>Re: Categorizing a Narrative based on keywords</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorizing-a-Narrative-based-on-keywords/m-p/3104764#M109344</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;, the column version worked for me. This helped me a lot. I really appreaciate it!&lt;/P&gt;</description>
      <pubDate>Tue, 28 Feb 2023 21:59:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Categorizing-a-Narrative-based-on-keywords/m-p/3104764#M109344</guid>
      <dc:creator>PetrM</dc:creator>
      <dc:date>2023-02-28T21:59:49Z</dc:date>
    </item>
  </channel>
</rss>

