Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Summarised table by dates - Max date not quite right

Hello! 

 

I have an existing table with customers, they all have one unique tenancy reference but each customer has multiple entries under different jobs. These jobs have unique job numbers and all have a different "logged dates"

Example 

 

Tenancy ref: 0000123 appears 5 times, each with a different "date logged" date. 

 

I would like to summarise the data to see ONLY the LAST logged date (the most recent), so I do not want 5 lines, only one and the one should only return the date which is the most recent. All I need is the tenancy ref and the most recent logged date. 

 

I have set the table up and used the following code but it is returning the last date for ALL the data, not the last date for each customer. 

 

What do I need to fix to make this return the last date at each tenancy ref level and not the last date of the data set level. 

 

Any help much appreciated! 

 

Last CRM = SELECTCOLUMNS(ADDCOLUMNS(SUMMARIZE('OpenHousing dbo_re_tenancy','OpenHousing dbo_re_tenancy'[tenancy_ref],"Max Date", MAX ('OpenHousing dbo_em_communication'[logged_date])),"Date", [Max Date]), "Tenancy ref", 'OpenHousing dbo_re_tenancy'[tenancy_ref],"Date", [Date])
 
 
THANK YOU! ๐Ÿ™‚ 

 

6 Replies