Forum Discussion
ksfx77
Helper I
5 years agoHow to select the most recent value from another table based on matching id's
Hi Guys, Happy Monday! I feel like this should be simple, but getting the most recent value in context has been tripping me up, and any guidance will be appreciated. I have a bunch of ses...
- 5 years ago
ksfx77 , you have to try a column like
new column =
var _max = maxx(filter(Table1, Table1[ID] = Table2[ID]), Table1[Date])
return
maxx(filter(Table1, Table1[ID] = Table2[ID] && Table1[Date] =_max), Table1[Value])
amitchandak
Super User
5 years agoksfx77 , you have to try a column like
new column =
var _max = maxx(filter(Table1, Table1[ID] = Table2[ID]), Table1[Date])
return
maxx(filter(Table1, Table1[ID] = Table2[ID] && Table1[Date] =_max), Table1[Value])
- ksfx775 years ago
Helper I
Thanks that indeed worked a charm!
Out of interest, if I wanted to chose the value based on a rank of the value itself, instead of the most recent date, is that a simple change?