Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Count with filter

Bonjour, 
J'ai cette formule qui calcule le nombre de salariés qui sont inscrit
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"})

Je voudrais exclure les salariés qui ont un état d'inscription réalisé que j'ai calculé avec cette formule :
CALCULATE(DISTINCTCOUNT('DIM - Inscription'[Key_base_inscription]),'DIM - Inscription','DIM - Inscription'[Etat d'inscription]in {"Réalisé","Partiellement Réalisé"})

Comment je peux faire svp ?
Le contexte j'ai des salariés qui ont des lignes à inscrits et des lignes à réalisé. 
Si je compte un salarié dans les réalisés je ne souhaite pas le compter dans les inscrits. 

merci par avance. 

2 ACCEPTED SOLUTIONS
ERD
Community Champion
Community Champion

@Anonymous , vous pouvez utiliser la formule comme suit:

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 )

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

View solution in original post

Anonymous
Not applicable

Hi @Anonymous ,

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.

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] )

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.

Registered Not Completed =
CALCULATE (
    DISTINCTCOUNT ( 'DIM - Inscription'[Key_base_inscription] ),
    KEEPFILTERS ( NOT 'DIM - Inscription'[Inscription status] IN { "Realized", "Partially Realized" } )
)

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

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.

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] )

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.

Registered Not Completed =
CALCULATE (
    DISTINCTCOUNT ( 'DIM - Inscription'[Key_base_inscription] ),
    KEEPFILTERS ( NOT 'DIM - Inscription'[Inscription status] IN { "Realized", "Partially Realized" } )
)

 

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

ERD
Community Champion
Community Champion

@Anonymous , vous pouvez utiliser la formule comme suit:

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 )

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly. Appreciate your Kudos.

Check out my latest demo report in the data story gallery.

Stand with Ukraine!


Here are official ways you can support Ukraine financially (accounts with multiple currencies):
1) Support the Armed Forces of Ukraine: https://bank.gov.ua/ua/about/support-the-armed-forces
2) Come Back Alive foundation: https://www.comebackalive.in.ua/

Thank you!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.