Forum Discussion

bklyn3's avatar
bklyn3
Advocate II
3 years ago
Solved

Reading a value from another table between dates ?

Hello

I am strugling with the following :

I have a table 1 with following info :

QuantityOrderFRom DateTo Date
1212401/01/2202/04/22
3212402/04/224/5/22
451244/5/2212/2/22



and a second table with a column order and a column date
How do I add a column in the second table with the value "Quantity" based on the column date ? 

OrderDateQuantity
1243/3/2232
1247/1/2245



  • Hi,

    Please check the below picture and the attached pbix file.

     

     

     

    Quantity CC =
    MAXX (
        FILTER (
            Table1,
            Table1[Order] = EARLIER ( Table2[Order] )
                && Table1[From Date] <= EARLIER ( Table2[Date] )
                && Table1[To Date] > EARLIER ( Table2[Date] )
        ),
        Table1[Quantity]
    )
    

2 Replies

  • Hi,

    Please check the below picture and the attached pbix file.

     

     

     

    Quantity CC =
    MAXX (
        FILTER (
            Table1,
            Table1[Order] = EARLIER ( Table2[Order] )
                && Table1[From Date] <= EARLIER ( Table2[Date] )
                && Table1[To Date] > EARLIER ( Table2[Date] )
        ),
        Table1[Quantity]
    )