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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Murali777
Helper III
Helper III

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.

 

Murali777_0-1655989129714.png

 

Kindly anyone pls help me.

 

@amitchandak @Icey @Jihwan_Kim 

 

1 ACCEPTED SOLUTION

@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]) )

 

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

Hi Amit,

 

I need code for calculated table not in the query editor. Kindly help me for DAX code for calculated Table.

@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]) )

 

Hi Amit,

 

Thanks for your code and your code is almost working. but my challenge is, i'm having bunch of columns and it returns all the column. 

 

I want only the 3 columns (Email, First Name, Last Name) in the calculated table.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.