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...
nickchobotar
Skilled Sharer
8 years agoHi thomasronn
Nope. That's not the case. My DAX works with the duplicate scenario you have brought up.
N -
nickchobotar
Skilled Sharer
8 years ago
Not sure where you are with your progress, I hope the DAX recipes that were offered to you were helpful.
I can see this to be a quite common business requirement, so I decided to post the solution in M code too.
= Table.AddColumn(#"Changed Type", "M Code",
(x) =>
List.Last(
Table.Column(
Table.SelectRows(
Table.Sort(Table1,"Date"),
each[ID] = x[ID]
), "Value"
)
), type number
)
Example Source data:
Table 1 ID Value Date 34 29 12/17/2017 34 29 12/17/2017 34 29 12/17/2017 34 29 12/17/2017 34 29 12/17/2017 12 26 12/15/2017 15 65 12/29/2017 45 100 12/23/2017 45 1 12/24/2017 12 94 12/25/2017 34 29 12/17/2017 15 41 12/27/2017 34 29 12/17/2017 Table 2 ID 12 34 45 15