Forum Discussion
Find most recent value based on two criteria
- 7 years ago
HI, Anonymous
Sorry for my careless and misunderstanding for the issue,
and you may try to this formula as below:
Consultant = MAXX ( TOPN ( 1, FILTER ( consultants, results[Client] = consultants[Client] && results[Date] >= consultants[Starting date] ), consultants[Starting date], DESC ), consultants[Consultant] )Regards,
Lin Li
Try something like:
Column =
VAR __table = RELATEDTABLE('Table21')
VAR __maxDate = MAXX(__table,[date])
RETURN
MAXX(FILTER(__table,[date]=__maxDate),[consultant])- Anonymous7 years agoNot applicable
Thanks a lot for your suggestion Greg. How do you suggest I relate these tables, as there are no many-to-one relationships possible. There are many dates as there are many clients.
I do get this formula working, but it only returns the consultant with the most recent date, and only for client results in that specific month. It does not respect the client to client match.- Greg_Deckler7 years ago
Community Champion
So are the tables related or no? You should be able to do a many-to-many now with composite models. Are they related by Date? If you could share some sample data and a pic of your relationships could potentially find a better solution.
- Anonymous7 years agoNot applicable
Hi Greg,
This is an example of the data (can't share the real thing). Should've mentioned I was trying to achieve this in Power Query. I don't know if the composite models are availabe there: