Forum Discussion

O-K's avatar
O-K
Frequent Visitor
2 years ago
Solved

Duplicate Data entries

Employees' ID have multiple entries (duplicated) sometimes more than once in the start date Ex.: Emp ID Dep Start date End date Status 23232A C 12/12/1999 12/12/2001 Active 2323...
  • DataNinja777's avatar
    2 years ago

    Hi O-K 

    You can get your required output as follows:

    1-  I would like to adjust the start date to be the end date of the previous (Latest) one and so.

     

    2- keeping only one Active status per employee (Latest)

    In addition to this, you can create a disconnected calendar table to do a flexible headcount analysis, but I didn't create a calendar table in this example. 

    I attach an example pbix file.  

     

  • O-K's avatar
    O-K
    2 years ago

    Firstly thank you for the quick response.
    I somehow keep getting an error in the second half

     

  • Khushidesai0109's avatar
    2 years ago

    Hiii Try this DAX
    Adjusted Department StartDate =
    VAR Departmentstartdate =
    CALCULATE(
    MAX('EU HR'[Adjusted End/present day]),
    FILTER(
    'EU HR',
    'EU HR'[Adjusted End/present day] < EARLIER('EU HR'[Adjusted End/present day])
    )
    )
    RETURN
    IF(
    ISBLANK(Departmentstartdate),
    'EU HR'[Adjusted End/present day],
    Departmentstartdate
    )

    If this solution helped you please give a thumbs up and accept this reply as a solution Thank You!! Regards!!