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
Anonymous
Not applicable

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.

employee_date.PNGSo, 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 5
TomMartens
Super User
Super User

Hey,

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


Did I answer your question? Mark my post as a solution, this will help others!

Proud to be a Super User!
I accept Kudos 😉
Hamburg, Germany
Anonymous
Not 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.

@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

and here: https://social.technet.microsoft.com/Forums/en-US/00a09332-fe6e-47a4-a8a9-b71e38b01a86/how-to-remove-duplicates-based-on-sort-order?forum=powerquery

This method absolutely works.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Anonymous
Not applicable

@kcantor , thank you for your reply! It does works if the goal is to get the last recording position overall time, which I already have. But, the filter dynamically changes the period. So, one employee during 2017 could be in Position 1, which has to be shown on the screen, but in 2018 was Position 2, that's the big problem

Arul
Super User
Super 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.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


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.