<?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 Word count from a sentence in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Word-count-from-a-sentence/m-p/3978951#M154280</link>
    <description>&lt;P&gt;I am trying to find the number of times particular texts appear in a description. For example if the description is " faulty item LAV-L3,LAV-L3F,LAV-L3R found". I want to count how many times "LAV-L3" was found in the text, but since LAV-L3R AND LAV-L3F also has LAV-L3 as part of the text,that is also being counted. I only want it to return count of 1. How to do it in Power Bi as DAX.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jun 2024 07:36:29 GMT</pubDate>
    <dc:creator>mithunishad</dc:creator>
    <dc:date>2024-06-07T07:36:29Z</dc:date>
    <item>
      <title>Word count from a sentence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Word-count-from-a-sentence/m-p/3978951#M154280</link>
      <description>&lt;P&gt;I am trying to find the number of times particular texts appear in a description. For example if the description is " faulty item LAV-L3,LAV-L3F,LAV-L3R found". I want to count how many times "LAV-L3" was found in the text, but since LAV-L3R AND LAV-L3F also has LAV-L3 as part of the text,that is also being counted. I only want it to return count of 1. How to do it in Power Bi as DAX.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 07:36:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Word-count-from-a-sentence/m-p/3978951#M154280</guid>
      <dc:creator>mithunishad</dc:creator>
      <dc:date>2024-06-07T07:36:29Z</dc:date>
    </item>
    <item>
      <title>Re: Word count from a sentence</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Word-count-from-a-sentence/m-p/3979520#M154293</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="756197" data-lia-user-login="mithunishad" class="lia-mention lia-mention-user"&gt;mithunishad&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try this approach:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;ExactMatchCount = 
VAR SearchText = "LAV-L3"
VAR SearchTextLength = LEN(SearchText)
VAR Description = [YourDescriptionColumn]
VAR DescriptionLength = LEN(Description)
VAR CleanedDescription = SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(Description, ",", " "), ".", " "), "-", " ")
VAR TextParts = TRIM(CLEAN(CleanedDescription))
VAR WordCount = 
    COUNTROWS(
        FILTER(
            GENERATESERIES(1, DescriptionLength - SearchTextLength + 1, 1),
            MID(CleanedDescription &amp;amp; " ", [Value], SearchTextLength) = SearchText
            &amp;amp;&amp;amp; MID(CleanedDescription &amp;amp; " ", [Value] + SearchTextLength, 1) IN {" ", "", ","}
        )
    )
RETURN
    WordCount
&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 07 Jun 2024 10:49:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Word-count-from-a-sentence/m-p/3979520#M154293</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2024-06-07T10:49:55Z</dc:date>
    </item>
  </channel>
</rss>

