Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
4 years ago
Solved

Get records between two dates

I have a table that has as a key the name of the person and has a date data this table is called patients. Number Date Stature Weight Santiago 12/05/2022 Laura 1/03/2021 ...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi Syndicate_Admin ,

     

    Please check these formulas.

    latest date = CALCULATE(MAX(HistoricalPatients[Date]),FILTER(HistoricalPatients,HistoricalPatients[Date]<=Patients[Date]&&HistoricalPatients[Number]=Patients[Number]))
    
    Stature = CALCULATE(MAX(HistoricalPatients[Stature]),FILTER(HistoricalPatients,HistoricalPatients[Number]=Patients[Number]&&HistoricalPatients[Date]=Patients[latest date]))
    
    Weight = CALCULATE(MAX(HistoricalPatients[Weight]),FILTER(HistoricalPatients,HistoricalPatients[Number]=Patients[Number]&&HistoricalPatients[Date]=Patients[latest date]))

     

    Best Regards,

    Jay