Forum Discussion
Inventory calculation - Based on expiry date
- 7 years ago
I found a solution using the CALCULATE function, with expiry date as filter.
Thanks to all that took their time to read my issue.
/depple
Ok,
Your explenation was not very clear. still isnt.
When is the expiery date? When is the trigger?
Sorry if I am being unclear. I will try to correct this.
This is the desired output of the measure given the data in the two tables I provided in the initial post:
Week
Item 201935 201936 201937 201938
Alfa 35 25 0 0
Bravo 100 100 100 0
For each future week, non-expired batches are summed. For the week that a batch has the expiry date, it will not be included in the inventory, for example the 10 Alfa that has expiry date 5/9-2019 (Week 201936) are not included in Week 201936, as they expire that week. The remaining 25 Alfa expire in 10/9-19, and therefore from 201937 and forwards, there a 0 Alfa in inventory.
Again, sorry for being unclear. I hope that this is a better explanation.
/depple
- depple7 years ago
Helper III
I found a solution using the CALCULATE function, with expiry date as filter.
Thanks to all that took their time to read my issue.
/depple
- Anonymous6 years agoNot applicable
hi depple,
can you give us the example where you use the filter?
i have also tried to do the same with calculate (distinctcount(field1),filter(allselected(table), [expirydate] >= [i still havent figured out what i should put in here]))
- Anonymous5 years agoNot applicable
Hello depple,
Trust you are great. Please can you help share the DAX measure you used to solve this problem? I have a similar issue I am currently on.
I want to show the cumulative inventory level considering the future expiry dates.
Thanks
deji