Forum Discussion
Adding conditional column with either value from other column OR the value from the row above
Hi, thank you for the swift reaction. Variables is competely new to me, so I really hope you can help me a little further. I've created a small dataset in an CSV-file and made it available from my Dropbox account:
I've created an Excelsheet with the desired results:
If I have the extra columns, in my Dashboard I can filter on rows that have in the column 'Stock_after_booking' a value < 0. By doing this I isolate all my project which have a potential problem and I also see which Purchase Orders I can try to influence in order to solve the problem.
I really hope you can help me with this, thanks in advance for your reply!
Kind regards, Daniel
Thank you for the sample data. Looking at it I don't see any fields that would be impacted by user filter choices. As such the new columns could be added in Power Query instead of DAX. Do you have any preferences?
- DanielB_NL2 years ago
Helper I
Hi lbendlin, PowerQuery would be fine as wel!! I don't have any preferences and am already very happy that you are putting your time and effort in it
- DanielB_NL2 years ago
Helper I
Hi lbendlin, I've extended the dataset with 2 more article numbers: the idea that the stock mutations over time are evaluated per article number, but after looking at the sample data again I wasn't sure that this was clear with the limited data sample. I think it is more clear this way.
- lbendlin2 years ago
Super User
I'm a bit lost as to what you are trying to achieve. Are you trying to predict when you run out of stock?
Your sample data may not be sufficient for the scenario.
- DanielB_NL2 years ago
Helper I
Yes I am. We have 4 types of mutations that influence the stock level:
- Purchase: receiving purchase orders
- Production: our own production from our shop factory
- Sales: sales via our Service Deparment
- Project: Usage on projects that are being assembled
My idea is
- That mutations are done in planned order, so I can put them ordered by date and see how stock fluctuates
- For mutations of type 3 and 4 there is a problem if after the mutation stock is below zero (of before the mutation, the mutation amount is bigger than the stock level)
- I want our Purchase Department to react and my first impression is that I can have up to 2 possibilities:
- If there is a purchase reception planned before the expected stock shortage: I can try to ask the supplier to increase the amount on that Purchase Order, but I need to now which Purchase Order I need to look at
- If there is a purchase reception planned after the expected stock shortage: I can try to ask the supplier to deliver earlier, but also for this goes that I need to know which Purchase Order to look at.
- Also for the Purchase reception that is planned after the expected stock shortage: if the difference in dates is less than or equal to 7 days, I can neglect them because for me that is still acceptable and not worth the effort to get the delivery a few days faster.
I hope you have an idea now of what I try to achieve