Forum Discussion
satlasg
Helper I
8 years agoGet most recent values on new table column
Hello, I have two tables A & B with "many to one" relationship, as below: I am looking for a formula to fill in 'Table B'[Value Latest] based on the Value from the more...
Greg_Deckler
Community Champion
8 years agoOK, I got rid of the MAXX, see if this works better.
Column2 =
var myMax = CALCULATE(MAX(IDValues[Date]),RELATEDTABLE(IDValues))
var myID = [ID]
RETURN LOOKUPVALUE('IDValues'[Value],'IDValues'[Date],myMax,'IDValues'[ID],myID)Zubair_Muhammad
Community Champion
8 years ago
In that case use FirstNonBlank instead of SUM. Here is the revised formula
Value latest =
VAR RecentDate =
CALCULATE ( MAX ( TableA[Date] ) )
RETURN
CALCULATE (
FIRSTNONBLANK ( TableA[Value], 1 ),
FILTER ( TableA, TableA[Date] = RecentDate )
)- satlasg8 years ago
Helper I
Tried that revised one, but again it seems to drain the memory, i am getting the same message and no result.
Value latest = VAR RecentDate = CALCULATE ( MAX ( TableA[Date] ) ) RETURN CALCULATE ( FIRSTNONBLANK ( TableA[Value], 1 ), FILTER ( TableA, TableA[Date] = RecentDate ) )