Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Most recent record from another table

Hi - I have two tabels with a many to relationship by ID. In Table 1 I have Note entries and there are multiple per ID. In table 2 I want to bring in the most recent date for each ID as well as the m...
  • az38's avatar
    6 years ago

    Hi Anonymous 

    try  a table

    Table 2 = SUMMARIZECOLUMNS('Table 1'[ID], 
    "Date", MAX('Table 1'[Date]),
    "Note", CALCULATE(MAX('Table 1'[Note]), FILTER('Table 1', 'Table 1'[Date]=[Date] && 'Table 1'[ID]=[ID])
    ))
  • mahoneypat's avatar
    6 years ago

    Here are two expressions for your calculated columns

     

    Latest Date = CALCULATE(MAX(Table1[Date]))

     

    Latest Note = CALCULATE(MAX(Table1[Note]), Table1[Date] = Table2[Latest Date])

     

    The 2nd one uses the result of the first one.

     

    If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

    Regards,

    Pat