<?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 Counting Text occurrences per Unique ID in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Text-occurrences-per-Unique-ID/m-p/2823572#M89699</link>
    <description>&lt;P&gt;Hello. I am trying to figure out how to make a measure to count the number of times a specific text appears in a column based on a Unique ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would look like this:&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Text&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Apple&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;Bannana&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Apple&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Bannana&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;Kiwi&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Bannana&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;Apple&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Bannana&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I wanted to count say "Bannna' it would give me 3 -- it would not count banana twice for the same ID. Apple would give me 3 and Kiwi would give me 1.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Oct 2022 17:30:28 GMT</pubDate>
    <dc:creator>MSW</dc:creator>
    <dc:date>2022-10-06T17:30:28Z</dc:date>
    <item>
      <title>Counting Text occurrences per Unique ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Text-occurrences-per-Unique-ID/m-p/2823572#M89699</link>
      <description>&lt;P&gt;Hello. I am trying to figure out how to make a measure to count the number of times a specific text appears in a column based on a Unique ID&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Would look like this:&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;TD&gt;Text&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Apple&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;Bannana&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Apple&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Bannana&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;Kiwi&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;Bannana&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;Apple&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;Bannana&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When I wanted to count say "Bannna' it would give me 3 -- it would not count banana twice for the same ID. Apple would give me 3 and Kiwi would give me 1.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 17:30:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Text-occurrences-per-Unique-ID/m-p/2823572#M89699</guid>
      <dc:creator>MSW</dc:creator>
      <dc:date>2022-10-06T17:30:28Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Text occurrences per Unique ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Text-occurrences-per-Unique-ID/m-p/2823594#M89701</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="368094" data-lia-user-login="MSW" class="lia-mention lia-mention-user"&gt;MSW&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;you may try&lt;/P&gt;
&lt;P&gt;DISTINCTCOUNT ( 'Table'[ID] )&lt;/P&gt;
&lt;P&gt;or&lt;/P&gt;
&lt;P&gt;COUNTROWS ( VALUES (&amp;nbsp;&lt;SPAN&gt;'Table'[ID] ) )&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 17:38:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Text-occurrences-per-Unique-ID/m-p/2823594#M89701</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-10-06T17:38:08Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Text occurrences per Unique ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Text-occurrences-per-Unique-ID/m-p/2823997#M89717</link>
      <description>&lt;P&gt;That doesn't give me the count based on the text criteria. That is giving me the total unique IDs of 3. I want to look at how many times a text criteria exists and only count it once per ID in the table.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 21:32:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Text-occurrences-per-Unique-ID/m-p/2823997#M89717</guid>
      <dc:creator>MSW</dc:creator>
      <dc:date>2022-10-06T21:32:53Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Text occurrences per Unique ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Text-occurrences-per-Unique-ID/m-p/2824123#M89723</link>
      <description>&lt;P&gt;I am getting 3 for Bannana with this DAX Measure :&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CountTextById = Calculate ( 
    COUNTROWS ( VALUES ( 'Fruits'[ID] ) ),
    FILTER(ALL('Fruits'), 'Fruits'[Text] = "Bannana")
)&lt;/LI-CODE&gt;&lt;P&gt;Tell me if it works for you.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 23:00:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Text-occurrences-per-Unique-ID/m-p/2824123#M89723</guid>
      <dc:creator>lazurens2</dc:creator>
      <dc:date>2022-10-06T23:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Counting Text occurrences per Unique ID</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Text-occurrences-per-Unique-ID/m-p/2824193#M89729</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="368094" data-lia-user-login="MSW" class="lia-mention lia-mention-user"&gt;MSW&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Yes but if you select a [Text] from the slicer it will give you the right number. Similirly if you place [Text] along with this measure in a table visual it should give the correct count for each text. If you are interested in summing these counts you can use&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;=
SUMX (
    VALUES ( 'Table'[Text] ),
    COUNTROWS ( CALCULATETABLE ( VALUES ( 'Table'[ID] ) ) )
)&lt;/LI-CODE&gt;
&lt;P&gt;This will give you 3 for banana, 3 for apple, 1 for kiwi and 7 for total. The total will change depending on the selected [Text] values. For example if you select "banana" and "kiwi" the total would be 4. You'll get the same number when using a card visual.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 01:00:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Counting-Text-occurrences-per-Unique-ID/m-p/2824193#M89729</guid>
      <dc:creator>tamerj1</dc:creator>
      <dc:date>2022-10-07T01:00:27Z</dc:date>
    </item>
  </channel>
</rss>

