Forum Discussion
Anonymous
3 years agoNot applicable
Finding most recent values between two tables
I've tried a couple of M formulas from older posts but I'm in the weeds with this one as an M Language novice. I have two tables. Both can be linked via the unique identifier "machine number". Pe...
- 3 years ago
Hello - this will do the trick... You will need to add the name of your previous step into the first line where indicated. Also, if your tables are named something other than "Parts Table" and "Complaints Table" then you will need to update those names in the script also. Please let me know if you have any questions.
Table.AddColumn(#"Your Previous Step Name Goes Here", "Custom", each List.Max ( Table.SelectRows(#"Parts Table", (x)=> x[Machine number]=[Machine number] and x[Release Date] < [Complaint Completed Date])[Part Number] ), Int64.Type)
jennratten
Super User
3 years agoHello - this will do the trick... You will need to add the name of your previous step into the first line where indicated. Also, if your tables are named something other than "Parts Table" and "Complaints Table" then you will need to update those names in the script also. Please let me know if you have any questions.
Table.AddColumn(#"Your Previous Step Name Goes Here", "Custom", each List.Max ( Table.SelectRows(#"Parts Table", (x)=> x[Machine number]=[Machine number] and x[Release Date] < [Complaint Completed Date])[Part Number] ), Int64.Type)