Forum Discussion
Federaske
5 years agoFrequent Visitor
Self referencing calculated column (referencing previous row) - Power M help
Good evening, hope you guys can help me! I inherited an old heavy-hard coded file with various cell references and formulas I am now trying to automate. I need one last step with my PQ query, I ...
- 5 years ago
Hi Federaske ,
Please add an index column in the query editor, and then use DAX to create the following new column:
Column = var on_order= CALCULATE(SUM('Table'[ON-ORDER]),FILTER(ALLEXCEPT('Table','Table'[PRODUCT ID]),EARLIER('Table'[Index])>='Table'[Index])) return 'Table'[ON-HAND]-on_orderBest Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
V-lianl-msft
Community Support
5 years agoHi Federaske ,
Please add an index column in the query editor, and then use DAX to create the following new column:
Column =
var on_order= CALCULATE(SUM('Table'[ON-ORDER]),FILTER(ALLEXCEPT('Table','Table'[PRODUCT ID]),EARLIER('Table'[Index])>='Table'[Index]))
return 'Table'[ON-HAND]-on_order
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Federaske
5 years agoFrequent Visitor
Hi Liang,
thank you very much! Works perfectly.
Thanks again,
Bye,
Federico