<?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 Help with extracting keywords from a column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-extracting-keywords-from-a-column/m-p/4403299#M174792</link>
    <description>&lt;P&gt;Hello Power BI Community&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help in extracting certain keywords from each cell in a column. I have a column called Tags. It is not a mandatory field to be populated so some cells may be blank. Some cells have only one tag (ex. Project) and some fields have multiple tags separated by a comma (ex. Project, Team- Project management). I want to extract the team names and include them in a slicer so that the entire dataset can be filtered by team name. The format is always Team- Name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help with DAX or other means would be helpful.&lt;/P&gt;</description>
    <pubDate>Mon, 10 Feb 2025 16:20:35 GMT</pubDate>
    <dc:creator>poweruser124</dc:creator>
    <dc:date>2025-02-10T16:20:35Z</dc:date>
    <item>
      <title>Help with extracting keywords from a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-extracting-keywords-from-a-column/m-p/4403299#M174792</link>
      <description>&lt;P&gt;Hello Power BI Community&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need some help in extracting certain keywords from each cell in a column. I have a column called Tags. It is not a mandatory field to be populated so some cells may be blank. Some cells have only one tag (ex. Project) and some fields have multiple tags separated by a comma (ex. Project, Team- Project management). I want to extract the team names and include them in a slicer so that the entire dataset can be filtered by team name. The format is always Team- Name&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help with DAX or other means would be helpful.&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 16:20:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-extracting-keywords-from-a-column/m-p/4403299#M174792</guid>
      <dc:creator>poweruser124</dc:creator>
      <dc:date>2025-02-10T16:20:35Z</dc:date>
    </item>
    <item>
      <title>Re: Help with extracting keywords from a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-extracting-keywords-from-a-column/m-p/4403626#M174802</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="454995" data-lia-user-login="poweruser124" class="lia-mention lia-mention-user"&gt;poweruser124&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;It would have beneficial if you had provided sample data containing all the variations of expected tags. Nevertheless, I assumed certain combinations for the "Tags" column you described and developed a DAX solution accordingly, as you posted in the DAX queries section.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can create a &lt;STRONG&gt;calculated column&lt;/STRONG&gt; with the following DAX :&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Category = 
VAR _length = LEN ( [Tags] )
VAR _posHypen = FIND ( "-", [Tags], 1, BLANK () )
VAR _posComma = FIND ( ",", [Tags], 1, BLANK () ) 

// Check if "Team - Category" is present first or, not and select category text
VAR _firstCat =
    IF (
        (
            _posHypen &amp;lt;&amp;gt; BLANK ()
                &amp;amp;&amp;amp; _posComma &amp;lt;&amp;gt; BLANK ()
        )
            &amp;amp;&amp;amp; _posComma &amp;gt; _posHypen,
        1,
        0
    )
VAR _firstCatText = LEFT ( [Tags], _posComma - 1 )
VAR _category =
    IF (
        _posHypen &amp;lt;&amp;gt; BLANK (),
        IF (
            _firstCat = 1,
            MID ( _firstCatText, _posHypen + 1, 5000 ),
            MID ( [Tags], _posHypen + 1, 5000 )
        )
    )
RETURN
    TRIM ( _category )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Here is the screenshot of the solution where we have successfully extracted the team name from various combinations in the "Tags" column.&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;I am also attaching the Power BI file for your reference. If this does not resolve your issue, please provide a sample dataset along with additional explanation, so that it would be easier to address the problem you are encountering.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Udit&lt;BR /&gt;&lt;BR /&gt;If this post &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accepting it as the solution&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&lt;BR /&gt;&lt;STRONG&gt;&lt;EM&gt;Appreciate your Kudo &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt;&lt;/EM&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":rocket:"&gt;🚀&lt;/span&gt; Let's Connect: &lt;A href="https://www.linkedin.com/in/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkedIn&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://www.youtube.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;YouTube&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://medium.com/@quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;Medium&lt;/STRONG&gt;&lt;/A&gt; || &lt;A href="https://github.com/quantumudit/" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;GitHub&lt;/STRONG&gt;&lt;/A&gt;&lt;BR /&gt;&lt;span class="lia-unicode-emoji" title=":sparkles:"&gt;✨&lt;/span&gt; Visit My Linktree: &lt;A href="https://linktr.ee/quantumudit" target="_blank" rel="noopener"&gt;&lt;STRONG&gt;LinkTree&lt;/STRONG&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT color="#339966"&gt;&lt;STRONG&gt;Proud to be a Super User&lt;/STRONG&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Feb 2025 19:43:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-extracting-keywords-from-a-column/m-p/4403626#M174802</guid>
      <dc:creator>quantumudit</dc:creator>
      <dc:date>2025-02-10T19:43:44Z</dc:date>
    </item>
  </channel>
</rss>

