Search code examples
dynamics-crmdataverse

D365/Dataverse - Create Calculated/Look Up Column that is set to the highest date in another table


I have Table 1. It is filled with dates a inspection is going on. Plumbing or Garden inspections for example.

Table 2 links to these appointments and has additional columns with details such as a Person assigned to the inspection, and what property the inspection is at. I need these two tables to be separate as described, and they are linked by a simple ID column.

Is it possible at all to add a column to Table 2 called 'Last Date of Plumbing Inspection'. The idea is for any given Property in Table 2, there can be multiple inspection entries in Table 1 for it. The point of this column is that it should look in Table 1, find the matching ID, find the latest inspection date out of all the Plumbing-related inspections, and then set the column value to that.

The problem I am having with this is it seems like calculated columns can ONLY implement logic using the columns of the table the calculated column was created in. In Table 2, I can't create a calculated column that interacts with Table 1 at all. I could create a look up column, but I can't combine calculated columns with look up columns. Is there a way to build this latest inspection date column without too much complexity?


Solution

  • Actually you can create a Rollup field and put a MAX aggregate function for achieving your requirement from related table. Read more

    enter image description here