March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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;
User1 | 01/01/2020 |
User1 | 01/01/2022 |
User2 | 01/01/2022 |
I need it to look like this;
User1 | 01/01/2022 |
User2 | 01/01/2022 |
Can anyone suggest how to do this? Thanks
Solved! Go to Solution.
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
Method 2: Create a calculated table
Table 2 =
SUMMARIZE (
'Table',
'Table'[UserID],
"Max Hire Date", CALCULATE ( MAX ( 'Table'[Hire_Date] ) )
)
Best Regards
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
Method 2: Create a calculated table
Table 2 =
SUMMARIZE (
'Table',
'Table'[UserID],
"Max Hire Date", CALCULATE ( MAX ( 'Table'[Hire_Date] ) )
)
Best Regards
@nick9one1
Create your new table as follows:
New Table:
ADDCOLUMNS(
DISTINCT( Table[UserID] ),
"Latest Hire Date" , CALCULATE( MAX( Table[Hire_Date ] ) )
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |