<?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 Simple Calculate Count in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simple-Calculate-Count/m-p/1006699#M12820</link>
    <description>&lt;P&gt;Hi, a simple question hopefully. I have a column with IDs ranging from 1-15. What is the correct DAX if I want to count just those data with ID &amp;lt;=5 and between 8-10?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying&amp;nbsp;=CALCULATE(COUNT(Table[ID]),Table[ID] &amp;lt;=5,Table[ID]&amp;gt;=8,Table[ID]&amp;lt;=10) - but I see this isn't correct?!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 03 Apr 2020 10:20:16 GMT</pubDate>
    <dc:creator>adavid999</dc:creator>
    <dc:date>2020-04-03T10:20:16Z</dc:date>
    <item>
      <title>Simple Calculate Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simple-Calculate-Count/m-p/1006699#M12820</link>
      <description>&lt;P&gt;Hi, a simple question hopefully. I have a column with IDs ranging from 1-15. What is the correct DAX if I want to count just those data with ID &amp;lt;=5 and between 8-10?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was trying&amp;nbsp;=CALCULATE(COUNT(Table[ID]),Table[ID] &amp;lt;=5,Table[ID]&amp;gt;=8,Table[ID]&amp;lt;=10) - but I see this isn't correct?!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;A&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 10:20:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simple-Calculate-Count/m-p/1006699#M12820</guid>
      <dc:creator>adavid999</dc:creator>
      <dc:date>2020-04-03T10:20:16Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Calculate Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simple-Calculate-Count/m-p/1006865#M12823</link>
      <description>&lt;P&gt;Hi. I don't think it will work like that. You need to attach those conditions as one. If you just add conditions with "commas" in calculate, those are "AND" one by one. Try this instead:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;CALCULATE(
    COUNT(Tabla[ID]);
    OR(
        AND(Tabla[ID]&amp;gt;=8 ; Tabla[ID]&amp;lt;=10);
        Tabla[ID] &amp;lt;=5
    )
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope this helps,&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 12:14:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simple-Calculate-Count/m-p/1006865#M12823</guid>
      <dc:creator>ibarrau</dc:creator>
      <dc:date>2020-04-03T12:14:36Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Calculate Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simple-Calculate-Count/m-p/1006903#M12824</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="11211" data-lia-user-login="ibarrau" class="lia-mention lia-mention-user"&gt;ibarrau&lt;/a&gt;&amp;nbsp;that looks like it works. Playing around, I see this also gets same result as your method:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;=CALCULATE(COUNT(Table[ID]),Table[ID]&amp;lt;=5 || Table[ID]&amp;gt;=8,Table[ID] &amp;lt;=10)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May I ask if that also looks OK to you or is it a coincidence that this gets same result?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Many thanks,&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 12:45:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simple-Calculate-Count/m-p/1006903#M12824</guid>
      <dc:creator>adavid999</dc:creator>
      <dc:date>2020-04-03T12:45:57Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Calculate Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simple-Calculate-Count/m-p/1006914#M12825</link>
      <description>&lt;P&gt;Hey. Yes, that will work for your actual condition. First asking it can be &amp;lt;=5 OR &amp;gt;=8 is something that will put the number in one spot and then you add a second mandatory condition that won't break the previous one saying it has to be &amp;lt;=10.&lt;BR /&gt;&lt;BR /&gt;The first post won't work because the conditions in and are not correlative. You can't ask the engine you want a value &amp;lt;5 and &amp;gt;8 at the same time. It's one or the other.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Regards,&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 12:50:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simple-Calculate-Count/m-p/1006914#M12825</guid>
      <dc:creator>ibarrau</dc:creator>
      <dc:date>2020-04-03T12:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Simple Calculate Count</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simple-Calculate-Count/m-p/1006925#M12827</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="11211" data-lia-user-login="ibarrau" class="lia-mention lia-mention-user"&gt;ibarrau&lt;/a&gt;&amp;nbsp;for your help. I appreciate it.&lt;/P&gt;&lt;P&gt;Best,&lt;/P&gt;&lt;P&gt;A&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2020 12:54:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Simple-Calculate-Count/m-p/1006925#M12827</guid>
      <dc:creator>adavid999</dc:creator>
      <dc:date>2020-04-03T12:54:38Z</dc:date>
    </item>
  </channel>
</rss>

