Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
I want to fetch the product details which is having max(contract_start_date)
Please find the sample model attached
Result :
Mark in yellow
If you want the max contract_start_date per product I'd create a flag field in the script:
JOIN (SupplierOrders)
LOAD product_key, max(contract_start_date) as contract_start_date, 1 as IsMaxContractStartDate
Resident SupplierOrders
Group By product_key;
You can then use that new field to select the records you need. Change your expressions to select them: sum({<IsMaxContractStartDate={1}>}[Order Qty])
If you want the max contract_start_date per product I'd create a flag field in the script:
JOIN (SupplierOrders)
LOAD product_key, max(contract_start_date) as contract_start_date, 1 as IsMaxContractStartDate
Resident SupplierOrders
Group By product_key;
You can then use that new field to select the records you need. Change your expressions to select them: sum({<IsMaxContractStartDate={1}>}[Order Qty])