<?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: Distinct Count with Filters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-with-Filters/m-p/2692925#M81141</link>
    <description>&lt;P&gt;Try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count gen 113 &amp;amp; 116 =
VAR gen113 =
    CALCULATETABLE (
        DISTINCT ( 'Training Certification'[Customer ID] ),
        'Training Certification'[CertificationName] = "GEN 113 Mitel Performance Analytics",
        'Training Certification'[IsActive] = TRUE
    )
VAR gen116 =
    CALCULATETABLE (
        DISTINCT ( 'Training Certification'[Customer ID] ),
        'Training Certification'[CertificationName] = "GEN 116 Software Assurance",
        'Training Certification'[IsActive] = TRUE
    )
RETURN
    COUNTROWS ( INTERSECT ( gen113, gen116 ) )&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 10 Aug 2022 15:14:25 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2022-08-10T15:14:25Z</dc:date>
    <item>
      <title>Distinct Count with Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-with-Filters/m-p/2692870#M81136</link>
      <description>&lt;P&gt;Hi All,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;From the data in the screenshot below I want to calculate the distinctcount of contactid when both Gen 113 and Gen 116 certifications are active for a contact. The answer for this set of data should be 2 but am I getting 0. Obviously I am doing something wrong. Please see my measure below.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Measure =&lt;BR /&gt;CALCULATE (&lt;BR /&gt;DISTINCTCOUNT ( 'Training Certification'[ContactId] ),&lt;BR /&gt;'Training Certification'[CertificationName] = "GEN 116 Software Assurance",&lt;BR /&gt;'Training Certification'[CertificationName] = "GEN 113 Mitel Performance Analytics",&lt;BR /&gt;'Training Certification'[IsActive] = TRUE&lt;BR /&gt;) + 0&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 14:52:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-with-Filters/m-p/2692870#M81136</guid>
      <dc:creator>kartiklal7</dc:creator>
      <dc:date>2022-08-10T14:52:42Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count with Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-with-Filters/m-p/2692898#M81140</link>
      <description>&lt;P&gt;I could suggest you use the Filter function&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALCULATE (
    DISTINCTCOUNT ( 'Training Certification'[ContactId] ),
    FILTER(ALL(Training Certification[CertificationName]),
        'Training Certification'[CertificationName] = "GEN 116 Software Assurance" &amp;amp;&amp;amp;
        'Training Certification'[CertificationName] = "GEN 113 Mitel Performance Analytics" &amp;amp;&amp;amp;
        'Training Certification'[IsActive] = TRUE
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;If it still doesn't work, try to drag the measure to your example table and debug the results&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kind regards,&lt;BR /&gt;José&lt;BR /&gt;&lt;I&gt;Please mark this answer as the solution if it resolves your issue.&lt;/I&gt;&lt;BR /&gt;&lt;I&gt;Appreciate your kudos! &lt;/I&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 15:17:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-with-Filters/m-p/2692898#M81140</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-08-10T15:17:50Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count with Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-with-Filters/m-p/2692925#M81141</link>
      <description>&lt;P&gt;Try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Count gen 113 &amp;amp; 116 =
VAR gen113 =
    CALCULATETABLE (
        DISTINCT ( 'Training Certification'[Customer ID] ),
        'Training Certification'[CertificationName] = "GEN 113 Mitel Performance Analytics",
        'Training Certification'[IsActive] = TRUE
    )
VAR gen116 =
    CALCULATETABLE (
        DISTINCT ( 'Training Certification'[Customer ID] ),
        'Training Certification'[CertificationName] = "GEN 116 Software Assurance",
        'Training Certification'[IsActive] = TRUE
    )
RETURN
    COUNTROWS ( INTERSECT ( gen113, gen116 ) )&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 10 Aug 2022 15:14:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-with-Filters/m-p/2692925#M81141</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-08-10T15:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: Distinct Count with Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-with-Filters/m-p/2692954#M81145</link>
      <description>&lt;P&gt;Thank you. This works perfectly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 Aug 2022 15:27:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Distinct-Count-with-Filters/m-p/2692954#M81145</guid>
      <dc:creator>kartiklal7</dc:creator>
      <dc:date>2022-08-10T15:27:13Z</dc:date>
    </item>
  </channel>
</rss>

