Forum Discussion
Tripb44
4 years agoHelper II
Running Total for Calculated Column
I am trying to calculate the remaining qty needed to be shipped per order -> per line. Below is an example of the date structure with "Current Output for Remaining Qty" as a column simply taking (Qt...
Anonymous
4 years agoNot applicable
Hi Tripb44 ,
Check the column.
Column =
var min_index = CALCULATE(MIN('Table'[index]),FILTER('Table','Table'[ordernum]=EARLIER('Table'[ordernum])&&'Table'[orderline]=EARLIER('Table'[orderline])))
var order_qty = CALCULATE(SUM('Table'[sellingorderqty]),FILTER('Table','Table'[index]=min_index))
var ship_qty = CALCULATE(SUM('Table'[sellingshipqty]),FILTER('Table','Table'[ordernum]=EARLIER('Table'[ordernum])&&'Table'[orderline]=EARLIER('Table'[orderline])&&'Table'[index]<=EARLIER('Table'[index])))
return
order_qty-ship_qty
Best Regards,
Jay