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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.