Forum Discussion
Getting the last employee position
Hey, guys, I've been facing an issue and hope you guys could help me. Explanation below and the tables and powerbi arquives can be downloaded here .
https://drive.google.com/drive/u/0/folders/1M7jcDi1_Z02VN_eGg7mkfI5qkXDIF9L1
I work in an enterprise where I have to show a table with the employee data filtered according to employee_code and admission_date. One of the fields is the position, which can be many over the years, so there is a table that logs the position change of each employee by date of the change, employee key and position key.
So, if the admission date is filtered from 2016 to 2018, the table has to show the last position of each employee between this period. However, I can't find a solution to that. Somebody has any clue and can help me?
5 Replies
- ArulSuper User
Hi Anonymous ,
Have you tried to sort the admission date by ascending order? If you try this you can get the last row as the last employee who joined the enterprise.
Thanks,
-Arul.
- TomMartensSuper UserHey,
can you please provide a pix file with sample data, but still reflects your data model. Upload the file to onedrive or dropbox and share the link.
Regards,
Tom- AnonymousNot applicable
Hey, TomMartens thank you for the reply! The sample is provided by a link in the description, you can also download here:
Arul , thank you for the reply! It doesn't solve my problem, the idea is to get the last position for each employee.- kcantorCommunity Champion
Anonymous
I have a similar table in my data with my sales team moving through different pods and my only needing the most recent record. What I do is to sort by date with the newest date first then perform a table buffer. After the table buffer, I delete duplicates to retain just the most recent. This is completed in powerquery and the instructions can be found here: https://www.youtube.com/watch?v=rqDdnNxSgHQ
This method absolutely works.