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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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.


Go to My LinkedIn Page


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.


Go to My LinkedIn Page


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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors