Forum Discussion
CraigMFuso
6 years agoFrequent Visitor
Required Stock carry calculation
Hi everyone. Hopefully some one can help. I am creating a report to show resellers if they are carrying the required level of stock needed. I need to calculate a minimum stock carry based ...
- 6 years ago
Hi CraigMFuso ,
Sorry for our mistake in the formula, we can try to use the following measure after build some relationship between tables:
Measure = var lastUpdate = MAX('Dealer SOH'[Last Updated]) return ROUNDUP ( CALCULATE ( SUM ( 'Customer Purchase History'[QTY] ), FILTER('Customer Purchase History', 'Customer Purchase History'[Trans_Datetime] >= lastUpdate - 365 && 'Customer Purchase History'[Trans_Datetime] < lastUpdate) ) / 52 * 4, 0 )
If it doesn't meet your requirement, Could you please show the exact expected result based on the Tables that you have shared?
Best regards,
v-lid-msft
6 years agoCommunity Support
Hi CraigMFuso ,
Sorry for our mistake in the formula, we can try to use the following measure after build some relationship between tables:
Measure =
var lastUpdate = MAX('Dealer SOH'[Last Updated])
return
ROUNDUP (
CALCULATE (
SUM ( 'Customer Purchase History'[QTY] ),
FILTER('Customer Purchase History',
'Customer Purchase History'[Trans_Datetime]
>= lastUpdate - 365
&& 'Customer Purchase History'[Trans_Datetime] < lastUpdate)
) / 52 * 4,
0
)
If it doesn't meet your requirement, Could you please show the exact expected result based on the Tables that you have shared?
Best regards,
CraigMFuso
6 years agoFrequent Visitor
Thanks v-lid-msft .
Once I changed my relationships by implimenting a basic product table your solution worked great.