Forum Discussion
learnbcvibe
3 years agoFrequent Visitor
Dax Help to Crack Qty Sold In FIFO Order
Hello Experts how can we Sale this item in Fifo Order. once the 1st Purchase is consumed then only it should take from the 2nd Purchase what is the way to acheive it. In this Eg: once item A has w...
learnbcvibe
3 years agoFrequent Visitor
i asked this question after googling alot and checked the forum also. i cant able to get any response match with this query.
kindly request all BI Experts pls help to Solve this issue
myesil
2 years agoRegular Visitor
This post solved similar question
Solved: Inventory Qutantity wise Againg Report FIFO - Microsoft Fabric Community
inStock =
VAR CurrentSymbol = Transactions[Symbol]
VAR CurrentDate = Transactions[date]
VAR CurrentLineQty = Transactions[Units]
VAR TotalPurchases =
SUMX (
FILTER (
Transactions,
Transactions[Symbol] = CurrentSymbol
&& Transactions[type] = "buy"
),
Transactions[Units]
) + 0
VAR TotalSales =
SUMX (
FILTER (
Transactions,
Transactions[Symbol] = CurrentSymbol
&& Transactions[type] = "sale"
),
Transactions[Units]
) + 0
VAR PurchasesAfterCurrentDate =
SUMX (
FILTER (
Transactions,
Transactions[Symbol] = CurrentSymbol
&& Transactions[type] = "buy"
&& Transactions[date] > CurrentDate
),
Transactions[Units]
) + 0
VAR CurrentStock =
MAX (
0,
MIN (
TotalPurchases - TotalSales - PurchasesAfterCurrentDate,
CurrentLineQty
)
)
VAR Result =
IF (
Transactions[type] = "Buy",
CurrentStock,
0
)
RETURN
Result