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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Distinct count of employee who left the company in that particular month (Attrition)

Hi All,

I am new to Power BI/DAX, need your help to calculate Attrition measure for the below data:

 

Input  
MonthEmployee keyLast working Day
1/1/20221111null
1/1/2022111221/01/2022
1/1/20221113null
2/1/2022222215/02/2022
2/1/2022222013/02/2022

 

And my ouput should be:

Output 
MonthAttrition
Jan-221
Feb-222

 

Please help me to get this logic for me,

 

Thanks

1 ACCEPTED SOLUTION
Watsky
Solution Sage
Solution Sage

Hi @Anonymous , If the Last Working Day column's data type is date you can do...

CALCULATE (
COUNTA ( 'Table'[Employee key] ),
ISBLANK ( 'Table'[Last working Day] ) = FALSE ()
)

if the Last Working Day column's data type is text then you can do....

CALCULATE (
COUNTA ( 'Table'[Employee key] ),
'Table'[Last working Day] <> "null"
)

Watsky_0-1659459804002.png

 


Did my answer(s) help you? Give it a kudos by clicking the Thumbs Up!
Did my post answer your question(s)? Mark my post as a solution. This will help others find the solution.

Proud to be a Super User!

View solution in original post

1 REPLY 1
Watsky
Solution Sage
Solution Sage

Hi @Anonymous , If the Last Working Day column's data type is date you can do...

CALCULATE (
COUNTA ( 'Table'[Employee key] ),
ISBLANK ( 'Table'[Last working Day] ) = FALSE ()
)

if the Last Working Day column's data type is text then you can do....

CALCULATE (
COUNTA ( 'Table'[Employee key] ),
'Table'[Last working Day] <> "null"
)

Watsky_0-1659459804002.png

 


Did my answer(s) help you? Give it a kudos by clicking the Thumbs Up!
Did my post answer your question(s)? Mark my post as a solution. This will help others find the solution.

Proud to be a Super User!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.