Forum Discussion
Calculate cost based on transaction date
- 4 years ago
RodrigoCenteno , Try
New column =
var _max = maxx(FILTER (Cost,Transaction[SKU] = Cost[SKU] && Transaction[DATE] <= Cost[STARTING DATE OF THE COST]),Cost[STARTING DATE OF THE COST])
return
maxx(FILTER (Cost,Transaction[SKU] = Cost[SKU] && Transaction[DATE] =_max ),Cost[cost])
RodrigoCenteno , Try
New column =
var _max = maxx(FILTER (Cost,Transaction[SKU] = Cost[SKU] && Transaction[DATE] <= Cost[STARTING DATE OF THE COST]),Cost[STARTING DATE OF THE COST])
return
maxx(FILTER (Cost,Transaction[SKU] = Cost[SKU] && Transaction[DATE] =_max ),Cost[cost])
Actually it didnt work. I made a check and it only gives me the values where the transaction date equals the starting date of the cost, and miss all the values after that date. I tried to correct it by modifying "Transaction[DATE] =_max" this by < or > but didnt work.