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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Bigboss
Regular Visitor

Bring the first next date value from different table greater than current column date.

I want to bring purchase value from table sell to return table. 

I want to bring the first min value which is greater than Return date, in this case it is going to be 18-Aug-23. 

 

Thanks

 

Sell Table
Purchase Datesor_rejection_crm_idGROSS_SALES_NET_DISC_GROSS_RET
09-Jun-230046R43ZPLJNLBGM90.91
09-Jun-230046R43ZPLJNLBGM9.92
15-Jul-230046R43ZPLJNLBGM97.98
25-Jul-230046R43ZPLJNLBGM107.44
02-Aug-230046R43ZPLJNLBGM349.37
18-Aug-230046R43ZPLJNLBGM57.85
29-Sep-230046R43ZPLJNLBGM49.59
08-Oct-230046R43ZPLJNLBGM86.94
10-Oct-230046R43ZPLJNLBGM45.54
10-Oct-230046R43ZPLJNLBGM101.07
18-Oct-230046R43ZPLJNLBGM90.91
28-Nov-230046R43ZPLJNLBGM94.2
03-Dec-230046R43ZPLJNLBGM99.18
14-Dec-230046R43ZPLJNLBGM114.05
17-Dec-230046R43ZPLJNLBGM66.12
19-Dec-230046R43ZPLJNLBGM99.17
21-Dec-230046R43ZPLJNLBGM105.78
21-Dec-230046R43ZPLJNLBGM52.48
21-Dec-230046R43ZPLJNLBGM20.25
27-Dec-230046R43ZPLJNLBGM66.12
09-Jan-240046R43ZPLJNLBGM74.38
09-Jan-240046R43ZPLJNLBGM113.06
08-Feb-240046R43ZPLJNLBGM209.63
12-Feb-240046R43ZPLJNLBGM204.96
16-Feb-240046R43ZPLJNLBGM37.72

 

Return Table
Return Datesor_rejection_crm_idPurchase Date
02-Aug-230046R43ZPLJNLBGM 
2 ACCEPTED SOLUTIONS
ryan_mayu
Super User
Super User

@Bigboss 

pls try this

purchase = minx(FILTER(Sell,'Sell'[Purchase Date]>'Return'[Return Date]),Sell[Purchase Date])
11.PNG
pls see the attachment below
 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

Write this calculated column formula in the Return table

Column = CALCULATE(MIN(Sell[Purchase Date]),FILTER(sell,Sell[sor_rejection_crm_id]=EARLIER('Return'[sor_rejection_crm_id])&&Sell[Purchase Date]>EARLIER('Return'[Return Date])))

Hope this helps.

Ashish_Mathur_0-1713236549532.png

 

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Your solution is great, @ryan_mayu and @Ashish_Mathur . It worked like a charm!

Hi, @Bigboss 

Have you solved the current problem? 

 

 

Best Regards

Jianpeng Li

Ashish_Mathur
Super User
Super User

Hi,

Write this calculated column formula in the Return table

Column = CALCULATE(MIN(Sell[Purchase Date]),FILTER(sell,Sell[sor_rejection_crm_id]=EARLIER('Return'[sor_rejection_crm_id])&&Sell[Purchase Date]>EARLIER('Return'[Return Date])))

Hope this helps.

Ashish_Mathur_0-1713236549532.png

 

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
ryan_mayu
Super User
Super User

@Bigboss 

pls try this

purchase = minx(FILTER(Sell,'Sell'[Purchase Date]>'Return'[Return Date]),Sell[Purchase Date])
11.PNG
pls see the attachment below
 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors