Forum Discussion
Calculated Table for distinct Email Id as Key and most recent value of Name
I need derived table for distinct email id with the latest first name and last name based on latest registration date time colum (DateTime column). Please find the below example for your reference.
Kindly anyone pls help me.
Murali777 , DAX code
filter(addcolumns(Table, "_Max", maxx(filter(Table, Table[Email] = earlier([Email])), [registration Date])), [_Max] = [registration Date])
or
new Table =
Var _1 = addcolumns(Table, "_Max", maxx(filter(Table, Table[Email] = earlier([Email])), [registration Date]))
return
calculatetable(_1, filter(_1, [_Max] = [registration Date]) )
5 Replies
- amitchandak
Super User
Murali777 , refer if this blog can help
https://exceleratorbi.com.au/remove-duplicates-keep-last-record-power-query/
- Murali777
Helper III
Hi Amit,
I need code for calculated table not in the query editor. Kindly help me for DAX code for calculated Table.
- amitchandak
Super User
Murali777 , DAX code
filter(addcolumns(Table, "_Max", maxx(filter(Table, Table[Email] = earlier([Email])), [registration Date])), [_Max] = [registration Date])
or
new Table =
Var _1 = addcolumns(Table, "_Max", maxx(filter(Table, Table[Email] = earlier([Email])), [registration Date]))
return
calculatetable(_1, filter(_1, [_Max] = [registration Date]) )