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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
netanel
Post Prodigy
Post Prodigy

HC ID Number count

Hey All!

 

I have a Person Number column
And I want to check from month to month whether a person has left work or joined
I thought of the following logic but it does not work for me
Maybe you Can help?
1. If Person Number existed in the previous month and now not then "left"
2. If Person Number did not exist in the previous month but exists now then "Join"

And put it in a separate column where you will have "left" or "join"

 

Sounds simple but it does not work for me ...

Link to file:

https://1drv.ms/f/s!AonyYI-TdspHgUhwngZ6OKvpnSsc








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki
2 REPLIES 2
Anonymous
Not applicable

Hi @netanel ,

 

I think you can try code as below to achieve your goal.

Count of Join =
VAR _SUMMAZIRE =
    SUMMARIZE (
        ALL ( 'Data HC' ),
        'Data HC'[Person Number],
        "MaxDate", CALCULATE ( MAX ( 'Data HC'[Date] ), ALL ( 'Data HC' ) ),
        "CountofDate", CALCULATE ( COUNT ( 'Data HC'[Date] ) ),
        "Personal MaxDate", CALCULATE ( MAX ( 'Data HC'[Date] ) )
    )
RETURN
    COUNTAX (
        FILTER ( _SUMMAZIRE, [CountofDate] = 1 && [Personal MaxDate] = [MaxDate] ),
        [Person Number]
    )
Count of left =
VAR _SUMMAZIRE =
    SUMMARIZE (
        ALL ( 'Data HC' ),
        'Data HC'[Person Number],
        "MaxDate", CALCULATE ( MAX ( 'Data HC'[Date] ), ALL ( 'Data HC' ) ),
        "CountofDate", CALCULATE ( COUNT ( 'Data HC'[Date] ) ),
        "Personal MaxDate", CALCULATE ( MAX ( 'Data HC'[Date] ) )
    )
RETURN
    COUNTAX (
        FILTER ( _SUMMAZIRE, [Personal MaxDate] = EOMONTH ( [MaxDate], -1 ) ),
        [Person Number]
    )

Result is as below.

RicoZhou_0-1651477301738.png

 

Best Regards,
Rico Zhou

 

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

Thanks @Anonymous 

Thanks for the help
But something is wrong
I do not know to point out exactly what the problem is
I also do not close well to numbers
And with you (your dates don't work either)

The logic is simple
Whoever was a month ago and today is not then he left
Anyone who was not a month ago and today is yes then joined

Attach again the file I arranged it a little more hope you understand

https://1drv.ms/f/s!AonyYI-TdspHgUhwngZ6OKvpnSsc

 

Thanks!








Did I answer your question?
Mark my post as a solution!
Appreciate your Kudos!

Connect on Linkedin
linkedin.com/in/netanel-shriki

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors