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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Egemeny
Frequent Visitor

Calculated Column for New Employee

Hi everyone,

 

I would like to create a reporting that shows new employees per month. For that I would like to have a calculated column that works out the 'New Employee' value and returns as '1' if the same employee number doesn not exist in the prior period.

 

Example: 1525 and 1526 return as '1' for 01/12/2019 as these employee code did not exist for 01/11/2019.

 

My challenge is,  mydataset has seperate calender table and employee data table and following DAX did not work.

I believe i need to create a connection.

 

New Employee =
VAR temp =
    FILTER (
        Table1,
        Table1[Employee Number] = EARLIER ( Table1[Employee Number] )
            && Table1[Period] < EARLIER ( Table1[Period] )
    )
RETURN
    IF ( COUNTROWS ( temp ) > 0, 0, 1 )

 

Your help really appreaciated and you can see the example pbix file here.

 

Thanks!

2 REPLIES 2
Thim
Resolver V
Resolver V

Just to make sure I understand the result you want.

 

If an emploee starts on the 02/11-2019, then they should be regarded as new for December 2019?

What if they start on the 31/11-2019?

 

Thank you in advance. 🙂

Egemeny
Frequent Visitor

Hey @Thim ,

thank you for your response and good question. 🙂

 

The result that i would like to see is all employees started a calender month before can be return as 1. 🙂

 

I hope it's clearer and thank you in advance.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.