Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
113 | |
110 | |
100 | |
39 | |
30 |