Forum Discussion
Cyclic reference when calculating a Stock using its previous day result
Hello,
I have a problem with a cyclic reference trying to calculate the stock of a final inspection process.
*Day stock is the result of Production - Scrap - Wharehouse entry + Initial Stock
*If an inventory is loaded, that day Initial Stock = Inventory. If not, Previous day stock is needed
That leads to a cyclic reference I can't avoid.
Day Stock =Production - Scrap - Wharehouse entry + Previous day (Production - Scrap - Wharehouse entry + Previous second day (Production - Scrap - Wharehouse entry + Previous third day ... and so on)
How can I solve it?
Here is some sample data,
Thanks.
Ramiro Diz
2 Replies
- daxCommunity Support
Hi RamiroDiz,
I think it is hard to calculate cycle reference in DAX. You need to create many measures for the previous day's value and the meausre will be beased on context, so it is hrad to get previous day's value(I complete a part of this). You might need to achieve this in other tools, then use this in PowerBI. Or you could try to ask other super users in forum for help.
Best Regards,
Zoe ZhiIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi,
It's not posible to create infinite measures to get the value im wishing because I don't know how many days will pass since the last inventory.
Thats why I'm trying to generate a calculated column that brings the previous Day Stock if Inventory is empty. But I'm not able to get what I need.Thanks for the answer,
Ramiro