Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
bklyn3
Advocate II
Advocate II

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



2 ACCEPTED SOLUTIONS
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1670056044459.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

View solution in original post

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1670056221356.png

 

 

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

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1670056221356.png

 

 

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

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
CNENFRNL
Community Champion
Community Champion

CNENFRNL_0-1670056044459.png


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.