<?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: How to count the number of words in a table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735311#M1980</link>
    <description>&lt;P&gt;Aaah, there it is!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/U&lt;/P&gt;</description>
    <pubDate>Tue, 09 Jul 2019 13:24:13 GMT</pubDate>
    <dc:creator>UNOFOR</dc:creator>
    <dc:date>2019-07-09T13:24:13Z</dc:date>
    <item>
      <title>How to count the number of words in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735174#M1960</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How do I count the words (not rows) in a specific table or column if there is more than one word in each cell.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;/Uno&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>Tue, 09 Jul 2019 11:16:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735174#M1960</guid>
      <dc:creator>UNOFOR</dc:creator>
      <dc:date>2019-07-09T11:16:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of words in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735214#M1964</link>
      <description>&lt;P&gt;DAX is not the right tool to deal with this. Use Power Query. I'm not even sure it's possible. If it is, it'll be extremely hard.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 11:36:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735214#M1964</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-09T11:36:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of words in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735216#M1965</link>
      <description>&lt;P&gt;Ok, thanks anyway&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 11:38:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735216#M1965</guid>
      <dc:creator>UNOFOR</dc:creator>
      <dc:date>2019-07-09T11:38:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of words in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735236#M1969</link>
      <description>&lt;P&gt;If you really need it in DAX, then here it is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[Word Count] =
var __selectedWord = SELECTEDVALUE( TableWithIndividualWords[Name] )
var __selectedWordLength = LEN( __selectedWord )
var __wordCount =
	SUMX(
		YourTable, -- this table will honor any filters you put on it 
		var __name = YourTable[Name]
		var __nameLength = LEN( __name ) 
		var __wordCountInRow =
			( __nameLenth - LEN(SUBSTITUTE( __name, __selectedWord, "")))
				/ __selectedWordLength
		return
			__wordCountInRow
	)
return
	__wordCount&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;But to get this working &lt;/SPAN&gt;you have to have a &lt;SPAN&gt;table&lt;/SPAN&gt; that stores &lt;SPAN&gt;all&lt;/SPAN&gt; the possible words you could encounter&amp;nbsp;&lt;SPAN&gt;in advance. And the table should stand on its own, without any relationships to any other table. I named the table&amp;nbsp;TableWithIndividualWords and it has only one column [Name] where you store all the possible words. To make this into a visual table you just drag the column from the table so that individual words are visible and drop the measure. It'll calculate the number of times the word appears anywhere in the first table (YourTable).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Darek&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 12:01:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735236#M1969</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-09T12:01:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of words in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735245#M1971</link>
      <description>&lt;P&gt;Thank you vary much.&amp;nbsp;&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;If you really need it in DAX, then here it is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;[Word Count] =
var __selectedWord = SELECTEDVALUE( TableWithIndividualWords[Name] )
var __selectedWordLength = LEN( __selectedWord )
var __wordCount =
	SUMX(
		YourTable, -- this table will honor any filters you put on it 
		var __name = YourTable[Name]
		var __nameLength = LEN( __name ) 
		var __wordCountInRow =
			( __nameLenth - LEN(SUBSTITUTE( __name, __selectedWord, "")))
				/ __selectedWordLength
		return
			__wordCountInRow
	)
return
	__wordCount&lt;/PRE&gt;&lt;P&gt;&lt;SPAN&gt;But to get this working &lt;/SPAN&gt;you have to have a &lt;SPAN&gt;table&lt;/SPAN&gt; that stores &lt;SPAN&gt;all&lt;/SPAN&gt; the possible words you could encounter&amp;nbsp;&lt;SPAN&gt;in advance. And the table should stand on its own, without any relationships to any other table. I named the table&amp;nbsp;TableWithIndividualWords and it has only one column [Name] where you store all the possible words. To make this into a visual table you just drag the column from the table so that individual words are visible and drop the measure. It'll calculate the number of times the word appears anywhere in the first table (YourTable).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Best&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Darek&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Wow, thanks. I guess the sentence "stores all the possible words you could encounter&amp;nbsp;in advance" will be the thing that makes it hard to use. Seems quite easy but appearently it is not. The problem occured when hade created a word map and wanted to creat a slicer from the words accouring in it.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;So you advice would be to instead create a separate table "by hand" using excel?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;/U&lt;/SPAN&gt;&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 12:14:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735245#M1971</guid>
      <dc:creator>UNOFOR</dc:creator>
      <dc:date>2019-07-09T12:14:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of words in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735249#M1973</link>
      <description>&lt;P&gt;No. My advice is to extract all individual words from the table using Power Query. This is the right tool to do it. Not Excel.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 12:20:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735249#M1973</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-09T12:20:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of words in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735254#M1974</link>
      <description>&lt;P&gt;This might help you:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.youtube.com/watch?v=HPDG_KXiLBo" target="_blank"&gt;https://www.youtube.com/watch?v=HPDG_KXiLBo&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 12:23:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735254#M1974</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-09T12:23:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of words in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735260#M1975</link>
      <description>&lt;P&gt;Ok, I will give it a try even if it´s a bit above my level.&amp;nbsp; Your help is much appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/U&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 12:32:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735260#M1975</guid>
      <dc:creator>UNOFOR</dc:creator>
      <dc:date>2019-07-09T12:32:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of words in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735268#M1976</link>
      <description>&lt;P&gt;This might be better:&amp;nbsp;&lt;A href="https://www.youtube.com/watch?v=YOmL57g3RMg" target="_blank"&gt;https://www.youtube.com/watch?v=YOmL57g3RMg&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 12:41:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735268#M1976</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-09T12:41:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of words in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735298#M1978</link>
      <description>&lt;P&gt;Hi there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Mate, the last link I sent you shows you exactly how to obtain a table with all the distinct words that you can find in your table. Please follow it and you'll have the table I was talking about. Then everything is very simple.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 13:08:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735298#M1978</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-09T13:08:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of words in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735311#M1980</link>
      <description>&lt;P&gt;Aaah, there it is!!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you very much!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;/U&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 13:24:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735311#M1980</guid>
      <dc:creator>UNOFOR</dc:creator>
      <dc:date>2019-07-09T13:24:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of words in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735647#M2019</link>
      <description>&lt;P&gt;It would be good if you could mark the post as the solution if it has solved your problem.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best&lt;/P&gt;&lt;P&gt;Darek&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 17:57:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735647#M2019</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-07-09T17:57:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to count the number of words in a table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735761#M2023</link>
      <description>Hi. Of course I will. (as soon as I figured out how)</description>
      <pubDate>Tue, 09 Jul 2019 20:49:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-count-the-number-of-words-in-a-table/m-p/735761#M2023</guid>
      <dc:creator>UNOFOR</dc:creator>
      <dc:date>2019-07-09T20:49:02Z</dc:date>
    </item>
  </channel>
</rss>

