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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
nick9one1
Helper II
Helper II

Summerise table based on UserID and Hiredate

I have a table of employees that lists all the roles employees have held within the company. I need UserID to be unique. Some employees have changed roles so the UserID is duplicated in multiple rows. 

I need to filter, or create a new table that has unique userId's, and takes the row that has the highest Hire_Date for each User ID.

eg the current table is like this;

User101/01/2020

User1

01/01/2022
User201/01/2022

 

I need it to look like this;

User1

01/01/2022
User201/01/2022

 

Can anyone suggest how to do this? Thanks

1 ACCEPTED SOLUTION
v-yiruan-msft
Community Support
Community Support

Hi @nick9one1 ,

I created a sample pbix file(see the attachment), please check if that is what you want.

Method 1: Using the aggregation Latest

Using the aggregation function LatestUsing the aggregation function Latest

Method 2: Create a calculated table

Table 2 =
SUMMARIZE (
    'Table',
    'Table'[UserID],
    "Max Hire Date", CALCULATE ( MAX ( 'Table'[Hire_Date] ) )
)

Create a calculated tableCreate a calculated table

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yiruan-msft
Community Support
Community Support

Hi @nick9one1 ,

I created a sample pbix file(see the attachment), please check if that is what you want.

Method 1: Using the aggregation Latest

Using the aggregation function LatestUsing the aggregation function Latest

Method 2: Create a calculated table

Table 2 =
SUMMARIZE (
    'Table',
    'Table'[UserID],
    "Max Hire Date", CALCULATE ( MAX ( 'Table'[Hire_Date] ) )
)

Create a calculated tableCreate a calculated table

Best Regards

Community Support Team _ Rena
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Fowmy
Super User
Super User

@nick9one1 
Create your new table as follows:

New Table:
ADDCOLUMNS(
	DISTINCT( Table[UserID] ),
	"Latest Hire Date" , CALCULATE( MAX( Table[Hire_Date ] ) )
)




Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors