Forum Discussion

ask's avatar
ask
Icon for Helper III rankHelper III
9 years ago
Solved

Find the matching date

i have 2 tables. I need to find the matching event date from Event date and create another column in Date table as Event date, and calculate how many days between date and event date,  for example: E...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Hi ask,

     

    You can add calculate column with minx function to get the specific event date, below is the sample:

     

    Logic: get all "event date" which large the current date, use minx function to get the min date.

    Event = MINX(FILTER(ALL('Event'),Event[Event Date]>=EARLIER('Date'[Date])),[Event Date])

     

     

    Diff = DATEDIFF([Date],[Event],DAY)

     

     

    Regards,

    Xiaoxin Sheng