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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
v-jianpeng-msft
Community Support
Community Support

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.