Forum Discussion
Get the value base on lastest date condition
- 3 years ago
Hi ngocrin1
Do you have an OrderID column in Delivery table? If so, you can use Merge queries feature. Select both OrderID and CustomerKey as matching columns. This will match the corresponding DeliveryDate based on OrderID and CustomerKey fast and easily.
If you don't have OrderID column in Delivery table, you can still use Merge queries feature but select only CustomerKey as matching column.
Then add a custom column with below code
let vOrderDate = [OrderDate] in List.Min(Table.SelectRows([Delivery Table], each [DeliveryDate] >= vOrderDate)[DeliveryDate])Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Hi ngocrin1
Do you have an OrderID column in Delivery table? If so, you can use Merge queries feature. Select both OrderID and CustomerKey as matching columns. This will match the corresponding DeliveryDate based on OrderID and CustomerKey fast and easily.
If you don't have OrderID column in Delivery table, you can still use Merge queries feature but select only CustomerKey as matching column.
Then add a custom column with below code
let vOrderDate = [OrderDate] in List.Min(Table.SelectRows([Delivery Table], each [DeliveryDate] >= vOrderDate)[DeliveryDate])
Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.
Tks. Excellent solution. I don't have OrderID so the "Add columns" step is exactly what I need.