Forum Discussion
LAST PURCHASE PRICE
Friends, how are you? I am in need of your help.
I have a table "A" with the purchase orders of the year, a table "B" with the transfers between deposits of these materials, a table "C" that is the calendar, and a table "D" that is the code of the items with which I relate both tables.
I need to have in the "transfers" table the price of the last purchase of each item.
Example:
Item 1, purchased on 1/8, Price of the last purchase prior to that date.
Item 2, purchased on 3/7, Price of the last purchase prior to that date.
Thanks a lot!!!
1 Reply
- amitchandakSuper User
Syndicate_Admin , Not very clear
One of the way to know last price as new column is
Last price =
var _max = maxx(filter(Table, [Item] =earlier([Item]) && [Date] <= earlier([date])) , [Date])
return
maxx(filter(Table, [Item] =earlier([Item]) && [Date] =_max) , [Price])
For the latest price refer
https://amitchandak.medium.com/power-bi-get-the-last-latest-value-of-a-category-d0cf2fcf92d0