Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hi,
I'm building dashboard in Direct Query mode.
Data = Asatdate, UserID, Name, Ethnicity
I'd like to create a oclumn "Ethnicity Type" and to put values from Ethnicity column if the UserID field is not duplicate, if it is duplicate then put the latest value for Ethnicity by date.
Thank you in advance for the help.
Thanks
Atif
Solved! Go to Solution.
Thanks for replying Xiaoxin. I've found the solution via sql query :).
Thanks for replying Xiaoxin. I've found the solution via sql query :).
Could you kindly post the SQL solution?
Thanks
Select field1,field2,field3
from (select field1,field2, field3,
row_number() over (partition by employeenumber order by (datefield "to pick the latest record") desc) as rn from tablename) as T
Where RN = 1
Select field1,field2,field3
from (select field1,field2, field3,
row_number() over (partition by employeenumber order by (datefield "to pick the latest record") desc) as rn from tablename) as T
Where RN = 1