Forum Discussion

APEREZ2's avatar
APEREZ2
Icon for Advocate I rankAdvocate I
4 years ago
Solved

How to define if date is in a range

Hi, I have the following problem. I need to relate the table of prices: StartingPrice EndPrice Product Unit Price 2021-03-01 2021-05-22 Apple Tree 1.24 2021-05-23 2021-07-31 Apple ...
  • Vijay_A_Verma's avatar
    4 years ago

    Use below formula in a custom column in second table. First table is PriceTbl.

    Table.SelectRows(PriceTbl, (x)=> x[StartingPrice]<=[Sales Date] and x[EndPrice]>=[Sales Date] and x[Product]=[Product]){0}[Unit Price]