Forum Discussion
patrick3
Helper II
6 years agoReturn value based on Date / Key pair
Hi all, I've got 2 tables: Date Unique Key Value 01/01/2019 abc123 5 01/02/2019 abc123 10 01/01/2019 abc456 5 01/02/2019 abc456 10 Date Unique Key Value ...
patrick3
Helper II
6 years agoAh you're right of course, just a typo on my end
az38
Community Champion
6 years agotry a measure in table2
Value =
var _maxDate = CALCULATE(MAX('Table1'[Date]);FILTER(ALL(Table1);Table1[Unique Key]=SELECTEDVALUE(Table2[Unique Key]) && Table1[Date]<SELECTEDVALUE(Table2[Date])))
RETURN
calculate(MAX('Table1'[Value]);FILTER(ALL(Table1);Table1[Date]=_maxDate && Table1[Unique Key]=SELECTEDVALUE(Table2[Unique Key])))
do not hesitate to give a kudo to useful posts and mark solutions as solution