Hello,
I have an SQL table
Table=Table1
InvestmentID
Name
Test1
Test2
Which I am showing in a datatable object
I have another table
Table=Table2
RecordID
InvestmentID
Amount
Date
I am trying to look up the Amount from Table2 and include it in the datatable showing the data for Table1. I have tried
1. Datatable is set to Table1 as its source. Adding a column to the data table and replacing the text field with Lookup(Table2, InvestmentID=Thisitem.InvestmentID, Amount) . This does pull in the first row of table2 and shows the amount but it shows the first row of Table2 for all entries in Table1 - it doesn't appear to be changing "Thisitem.InvestmentID" as the row changes in the table.
2. Using the AddColumn function in the datatable items field. Addcolumns('Table1', "Amount", Lookup(Table2, InvestmentID=Table1[@InvestmentID]), Amount). I get the same result as attempt1 above
What am i doing wrong??
Bonus question if the above is solved. If there are multiple rows in Table2 for each investment in Table1 how would I return only the row with the most recent Date?
Regards
G