Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Lookup between two dates

Hi All,   I have two tables/queries (snippet below) and what I am trying to do is match the driver from the table/query 1 to table/query 2 based on the following criteria - Car (Table2) matches Car...
  • LivioLanzo's avatar
    7 years ago

    Are you looking to do it with a calculated table?

     

     

    Table =
    ADDCOLUMNS (
        Table2,
        "Driver",
        VAR tCar = Table2[Car]
        VAR Dte = Table2[Report Date]
        RETURN
            CALCULATE (
                VALUES ( Table1[Driver] ),
                Table1[Car] = tCar,
                Table1[Commence Date] <= dte,
                Table1[End Date] >= Dte
            )
    )