Forum Discussion
Anonymous
7 years agoNot applicable
Subtracting rows
Hi All, I would like to subtract lines in Power BI. Substract lines based on product id and ship date. "After shipping "is calculated column which values are correct only for 1 line. ...
- Anonymous7 years ago
Anonymous ,
We don't need to create Table2. Please group Material in Power BI Desktop query editor, then create the following columns in table1. For more details, please check attached PBIX file.shipcum = CALCULATE(SUM (Table1[To Ship] ), ALLEXCEPT( Table1,Table1[Material]), Table1[Index] <= EARLIER ( Table1[Index] ))Column = CALCULATE(MAX(Table1[Inventory on Hand]),ALLEXCEPT(Table1,Table1[Material]),Table1[Index]=1)
After shipping = Table1[Column]-Table1[shipcum]
Regards,
Lydia
Anonymous
7 years agoNot applicable
Hi Lydia,
This is very impresive, very close but, I would desire more as below.
Thanks.
Anonymous
7 years agoNot applicable
Anonymous ,
We don't need to create Table2. Please group Material in Power BI Desktop query editor, then create the following columns in table1. For more details, please check attached PBIX file.
shipcum = CALCULATE(SUM (Table1[To Ship] ),
ALLEXCEPT( Table1,Table1[Material]),
Table1[Index] <= EARLIER ( Table1[Index] ))
Column = CALCULATE(MAX(Table1[Inventory on Hand]),ALLEXCEPT(Table1,Table1[Material]),Table1[Index]=1)
After shipping = Table1[Column]-Table1[shipcum]
Regards,
Lydia