Forum Discussion
Anonymous
7 years agoNot applicable
Look up value based on two criteria?
So I have 3 columns involved in this issue. [Name], [Date], and [ID]. The [ID] column is unique but can contain multiple [Name] values for each [ID]. What I want to return is the most recent [Name] based on the [ID] using the [Date] column. How would I go about doing this?
Anonymous try followin measure
Recent Name = VAR __latestDate = CALCULATE( MAX( Table[Date]), ALLEXCEPT( Table, Table[Id]) ) RETURN CALCULATE( MAX( Table[Name]), Table[Date] = __latestDate )
Add a table visual, put Id and Recent Name measure on and you will have the result
5 Replies
- parry2kSuper User
Anonymous try followin measure
Recent Name = VAR __latestDate = CALCULATE( MAX( Table[Date]), ALLEXCEPT( Table, Table[Id]) ) RETURN CALCULATE( MAX( Table[Name]), Table[Date] = __latestDate )
Add a table visual, put Id and Recent Name measure on and you will have the result
- AnonymousNot applicable
Thank you parry2k. Is there a way to do this but for a calculated column instead?
- AnonymousNot applicable
Any other ideas? I need a calculated column as I need to use a matrix instead of a table.