Forum Discussion

Titouli's avatar
Titouli
New Member
2 years ago
Solved

Adding a column returning an index from a list of dates (Index for a "VLookUp")

Hi everyone, Here is the problem that I want to solve in POWER QUERY (in M Language). I have 2 tables: The first (several hundred of rows) presents a date field [QDates] (descending order):   (E...
  • HotChilli's avatar
    2 years ago

    In Power Query, add a custom column in the first table :

    let x = [Qdates] in List.Max(List.Select(Table2[PDates], each _ < x))

    This will add the matching date that you require.

    I'll leave it to you to add the 0 or 1 or 2 which you can get from the date.