Forum Discussion
Anonymous
6 years agoNot applicable
Return Latest Price for Multiple Lines
Hello all! First off, thanks in advance for any help anyone can provide, it is greatly appreciated! I have done a lot of searching, and can't quite find anything that I can get to work. As some...
- 6 years ago
Hi, Anonymous
Based on your description, I created data to reproduce your scenario.
InventorySitesOn-Hand:
InventItemPrices:
There is many-to-one relationship between 'InventItemPrices' and 'InventorySitesOn-Hand' tables.
You may create a calculated column in InventorySitesOn-Hand as below.
Result = var _itemnum = 'InventorySitesOn-Hand'[ItemNumber] var _latestdatetime = CALCULATE( MAX(InventItemPrices[PriceCreatedDateTime]), FILTER( ALL(InventItemPrices), InventItemPrices[ItemNumber] = _itemnum ) ) var _price = CALCULATE( SUM(InventItemPrices[Price]), FILTER( ALL(InventItemPrices), InventItemPrices[PriceCreatedDateTime] = _latestdatetime&& InventItemPrices[ItemNumber] = _itemnum ) ) return [OnHandQuantity]*_priceResult:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
luchitogiuse
5 years agoFrequent Visitor
v-alq-msft THANKSS!! i've been trying for days!
It helped me a lot! thanks for your help!