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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

How to get value from another table based on condition and specific period

Hello,

 

I'm in stuck with my problem. Let's say I have 2 tables: Quotes and Shipments. My goal is to transfer QuoteID from Quotes table into Shipments table if such conditions are met:

 

Condintion = Condition

Departure is between StartDate and ExpiryDate

 

please see my file via this link

1 ACCEPTED SOLUTION
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

You could try this:

Quote ID =
CALCULATE (
    FIRSTNONBLANK ( Quotes[Quote ID], 1 ),
    FILTER (
        Quotes,
        Quotes[Condition] = EARLIER ( Shipments[Condition] )
            && EARLIER ( Shipments[Departure] ) >= Quotes[StartDate]
            && EARLIER ( Shipments[Departure] ) <= Quotes[ExpiryDate]
    )
)

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
shairad
Regular Visitor

Thank you @v-yulgu-msft this works great

v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

You could try this:

Quote ID =
CALCULATE (
    FIRSTNONBLANK ( Quotes[Quote ID], 1 ),
    FILTER (
        Quotes,
        Quotes[Condition] = EARLIER ( Shipments[Condition] )
            && EARLIER ( Shipments[Departure] ) >= Quotes[StartDate]
            && EARLIER ( Shipments[Departure] ) <= Quotes[ExpiryDate]
    )
)

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Thank you, @v-yulgu-msft, it worked as expected!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Kudoed Authors