Forum Discussion
Challenge
I have two columns, the entry date of a product, and the leave date of a product. In another table i have a dimension table of days.
I need to select a date in dimension table of days(as a filter), then this date filter the products that have entry date lower than the selected date, and calculate until the selected date how many days the product have betwen the entry date and selected date OR if lower than leave date, use the leave date to calculate. And i need the sum of days that the product stayed in stock.
Thnx for help.
3 Replies
- littlemojopuppyCommunity Champion
Hi Vitore can you provide some sample data to work with?
- v-deddai1-msftCommunity Support
Hi Vitore ,
Would you please show us your expected output? I don't understand "OR if lower than leave date, use the leave date to calculate." well.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best Regards,
Dedmon Dai
- VitoreFrequent Visitor
I need to see how many days the item was in stock that month by the date i use was input, that is the diference of days the item enter the stock until the day I input. However, this item could be out stock earlier than the day I use as input, than the function need first verify the leave date of product is less than the input date. If less use the leave date, if superior use the input date. The output is the sum of diference of days.