Forum Discussion
Anonymous
8 years agoNot 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
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
3 Replies
- v-yulgu-msft
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
- AnonymousNot applicable
Thank you, v-yulgu-msft, it worked as expected!
- shairadRegular Visitor
Thank you v-yulgu-msft this works great