Forum Discussion
amaniramahi
7 years agoHelper V
Average Stock days
Hi, I have two tables, the first one contains SKUs and the order no. for each one. and the other table contains the order no. and receiving date for each order no. I created a measure to cal...
- 6 years ago
Hi amaniramahi ,
Firstly you can use calculate column to calculate the days in stock for each order
days in stock = DATEDIFF ( Receiving[Receive Date], TODAY (), DAY )
Then we can use create this measure to meet your requirement.
average-stock-days = AVERAGEX ( Stock, LOOKUPVALUE ( Receiving[days in stock], Receiving[Order], [Order No.] ) )BTW, pbix as attached.
Best regards,
Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more
v-lid-msft
6 years agoCommunity Support
Hi amaniramahi ,
Firstly you can use calculate column to calculate the days in stock for each order
days in stock = DATEDIFF ( Receiving[Receive Date], TODAY (), DAY )
Then we can use create this measure to meet your requirement.
average-stock-days =
AVERAGEX (
Stock,
LOOKUPVALUE ( Receiving[days in stock], Receiving[Order], [Order No.] )
)
BTW, pbix as attached.
Best regards,
Community Support Team _ DongLi
If this post helps, then please consider Accept it as the solution to help the other members find it more
amaniramahi
6 years agoHelper V
v-lid-msft Thank you so much! it worked prefectly