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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.