<?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: Count with filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-with-filter/m-p/3416334#M129268</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;, vous pouvez utiliser la formule comme suit:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;inscrit =
VAR real =
    CALCULATETABLE (
        VALUES ( 'DIM - Inscription'[Key_base_inscription] ),
        'DIM - Inscription'[Etat d'inscription]
            IN { "Réalisé", "Partiellement Réalisé" }
    )
VAR inscrit =
    CALCULATETABLE (
        VALUES ( 'DIM - Inscription'[Key_base_inscription] ),
        'DIM - Inscription'[Etat d'inscription]
            IN {
                "Inscrit libre-accès",
                "Inscription validées",
                "Convoqué sans notification",
                "Convoqué avec notification"
            }
    )
VAR excl = EXCEPT ( inscrit, real )
RETURN
    CALCULATE ( DISTINCTCOUNT ( 'DIM - Inscription'[Key_base_inscription] ), excl )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 05 Sep 2023 18:47:24 GMT</pubDate>
    <dc:creator>ERD</dc:creator>
    <dc:date>2023-09-05T18:47:24Z</dc:date>
    <item>
      <title>Count with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-with-filter/m-p/3415588#M129220</link>
      <description>&lt;P&gt;Bonjour,&amp;nbsp;&lt;BR /&gt;J'ai cette formule qui calcule le nombre de salariés qui sont inscrit&lt;BR /&gt;CALCULATE(DISTINCTCOUNT('DIM - Inscription'[Key_base_inscription]),'DIM - Inscription','DIM - Inscription'[Etat d'inscription]in {"Inscrit libre-accès","Inscription validées","Convoqué sans notification","Convoqué avec notification"})&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Je voudrais exclure les salariés qui ont un état d'inscription réalisé que j'ai calculé avec cette formule :&lt;BR /&gt;CALCULATE(DISTINCTCOUNT('DIM - Inscription'[Key_base_inscription]),'DIM - Inscription','DIM - Inscription'[Etat d'inscription]in {"Réalisé","Partiellement Réalisé"})&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Comment je peux faire svp ?&lt;BR /&gt;Le contexte j'ai des salariés qui ont des lignes à inscrits et des lignes à réalisé.&amp;nbsp;&lt;BR /&gt;Si je compte un salarié dans les réalisés je ne souhaite pas le compter dans les inscrits.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;merci par avance.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2023 12:19:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-with-filter/m-p/3415588#M129220</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-05T12:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Count with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-with-filter/m-p/3416334#M129268</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;, vous pouvez utiliser la formule comme suit:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;inscrit =
VAR real =
    CALCULATETABLE (
        VALUES ( 'DIM - Inscription'[Key_base_inscription] ),
        'DIM - Inscription'[Etat d'inscription]
            IN { "Réalisé", "Partiellement Réalisé" }
    )
VAR inscrit =
    CALCULATETABLE (
        VALUES ( 'DIM - Inscription'[Key_base_inscription] ),
        'DIM - Inscription'[Etat d'inscription]
            IN {
                "Inscrit libre-accès",
                "Inscription validées",
                "Convoqué sans notification",
                "Convoqué avec notification"
            }
    )
VAR excl = EXCEPT ( inscrit, real )
RETURN
    CALCULATE ( DISTINCTCOUNT ( 'DIM - Inscription'[Key_base_inscription] ), excl )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Sep 2023 18:47:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-with-filter/m-p/3416334#M129268</guid>
      <dc:creator>ERD</dc:creator>
      <dc:date>2023-09-05T18:47:24Z</dc:date>
    </item>
    <item>
      <title>Re: Count with filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-with-filter/m-p/3418775#M129390</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;One way to exclude employees who have a completed enrolment status is to use the EXCEPT function, which returns a table that contains the rows of one table minus all the rows of another table.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Registered Not Completed =
VAR Registered =
    FILTER (
        'DIM - Inscription',
        'DIM - Inscription'[Inscription status]
            IN {
                "Inscrit libre-accès",
                "Inscription validées",
                "Convoqué sans notification",
                "Convoqué avec notification"
            }
    )
VAR Completed =
    FILTER (
        'DIM - Inscription',
        'DIM - Inscription'[Inscription status] IN { "Realized", "Partially Realized" }
    )
VAR Result =
    EXCEPT ( Registered, Completed )
RETURN
    DISTINCTCOUNT ( Result[Key_base_inscription] )
&lt;/LI-CODE&gt;
&lt;P&gt;Another way to exclude employees who have a completed enrolment status is to use the NOT and IN operators, which allow you to specify a logical condition that negates or includes a set of values.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Registered Not Completed =
CALCULATE (
    DISTINCTCOUNT ( 'DIM - Inscription'[Key_base_inscription] ),
    KEEPFILTERS ( NOT 'DIM - Inscription'[Inscription status] IN { "Realized", "Partially Realized" } )
)
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490" target="_blank"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;BR /&gt;Community Support Team _ Rongtie&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&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>Thu, 07 Sep 2023 01:36:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Count-with-filter/m-p/3418775#M129390</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-09-07T01:36:48Z</dc:date>
    </item>
  </channel>
</rss>

