Forum Discussion
gan5133
8 years agoRegular Visitor
Credits Assignment to Prior Purchase Invoices
Using Power Pivot, I've built a model that lists prior invoices, newest to oldest, and need to write a DAX formula that scans the purchase quantity and identifies the rows (quantity) that add up to t...
- 8 years ago
Hi gan5133
Try this Calculated Column
Assigned = VAR CumulativeQty = CALCULATE ( SUM ( Table1[Purchase Qty] ), FILTER ( ALLEXCEPT ( Table1, Table1[NDC_AcctID] ), Table1[DateOfSale] >= EARLIER ( [DateOfSale] ) ) ) RETURN IF ( CumulativeQty <= 7, "Assign", "Remove" )
Zubair_Muhammad
8 years agoCommunity Champion
Hi gan5133
Try this Calculated Column
Assigned =
VAR CumulativeQty =
CALCULATE (
SUM ( Table1[Purchase Qty] ),
FILTER (
ALLEXCEPT ( Table1, Table1[NDC_AcctID] ),
Table1[DateOfSale] >= EARLIER ( [DateOfSale] )
)
)
RETURN
IF ( CumulativeQty <= 7, "Assign", "Remove" )