Forum Discussion
Anonymous
6 years agoNot applicable
Inventory challenge
I've posted about this but so far have been unsuccessful in getting a solution. Any help is very appreciated. So, will try again to give a full explanation of what I need help with: 1. I hav...
v-lid-msft
6 years agoCommunity Support
Hi Anonymous ,
Sorry for our late reply, We can try to use the following measures to meet your requirement:
Current Month Demand = CALCULATE(SUM('Flu_PlanPegging'[Outstanding Requirement]))
Total Demand = CALCULATE(SUM('Flu_PlanPegging'[Outstanding Requirement]), FILTER(ALLSELECTED('Flu_PlanPegging'),'Flu_PlanPegging'[Item] in FILTERS('Items Bridge'[Item]) && 'Flu_PlanPegging'[Due Date] <= MAX('Date Table'[Date])))
Qty on Hand or Surplus =
VAR CurrentQty =
CALCULATE (
SUM ( 'Items Bridge'[Quantity On Hand] ),
FILTER (
ALLSELECTED ( 'Items Bridge' ),
'Items Bridge'[Item] IN FILTERS ( 'Items Bridge'[Item] )
)
)
RETURN
SWITCH (
TRUE (),
SELECTEDVALUE ( 'Date Table'[MonthOfYear] )
< MONTH ( MIN ( 'Items Bridge'[Last Gen Date] ) ), CurrentQty
+ CALCULATE (
SUM ( 'Flu_PlanPegging'[Outstanding Requirement] ),
FILTER (
ALLSELECTED ( 'Flu_PlanPegging' ),
'Flu_PlanPegging'[Item] IN FILTERS ( 'Items Bridge'[Item] )
&& 'Flu_PlanPegging'[Due Date] < MIN ( 'Items Bridge'[Last Gen Date] )
&& 'Flu_PlanPegging'[Due Date] >= MIN ( 'Date Table'[Date] )
)
),
SELECTEDVALUE ( 'Date Table'[MonthOfYear] )
= MONTH ( MIN ( 'Items Bridge'[Last Gen Date] ) ), CurrentQty,
SELECTEDVALUE ( 'Date Table'[MonthOfYear] )
> MONTH ( MIN ( 'Items Bridge'[Last Gen Date] ) ), CurrentQty
- CALCULATE (
SUM ( 'Flu_PlanPegging'[Outstanding Requirement] ),
FILTER (
ALLSELECTED ( 'Flu_PlanPegging' ),
'Flu_PlanPegging'[Item] IN FILTERS ( 'Items Bridge'[Item] )
&& 'Flu_PlanPegging'[Due Date] > MIN ( 'Items Bridge'[Last Gen Date] )
&& 'Flu_PlanPegging'[Due Date] <= MAX ( 'Date Table'[Date] )
)
)
)
If it doesn't meet your requirement, Could you please show the exact expected result of the 20303A based on the Tables that you have shared?
Best regards,
Anonymous
6 years agoNot applicable
Hello - Did you see my reply?
- v-lid-msft6 years agoCommunity Support
Hi Anonymous ,
Sorry for delay in response, We can change our measures to following to meet your requirement:
Qty on Hand or Surplus = VAR CurrentQty = CALCULATE ( SUM ( 'Items Bridge'[Quantity On Hand] ), FILTER ( ALLSELECTED ( 'Items Bridge' ), 'Items Bridge'[Item] IN FILTERS ( 'Items Bridge'[Item] ) ) ) RETURN SWITCH ( TRUE (), SELECTEDVALUE ( 'Date Table'[MonthOfYear] ) = MONTH ( MIN ( 'Items Bridge'[Last Gen Date] ) ), CurrentQty, SELECTEDVALUE ( 'Date Table'[MonthOfYear] ) > MONTH ( MIN ( 'Items Bridge'[Last Gen Date] ) ), CurrentQty - CALCULATE ( SUM ( 'Flu_PlanPegging'[Outstanding Requirement] ), FILTER ( ALLSELECTED ( 'Flu_PlanPegging' ), 'Flu_PlanPegging'[Item] IN FILTERS ( 'Items Bridge'[Item] ) && 'Flu_PlanPegging'[Due Date] > MIN ( 'Items Bridge'[Last Gen Date] ) && 'Flu_PlanPegging'[Due Date] <= MAX ( 'Date Table'[Date] ) ) ),BLANK() )Total Demand = CALCULATE ( SUM ( 'Flu_PlanPegging'[Outstanding Requirement] ), FILTER ( ALLSELECTED ( 'Flu_PlanPegging' ), 'Flu_PlanPegging'[Item] IN FILTERS ( 'Items Bridge'[Item] ) && 'Flu_PlanPegging'[Due Date] <= MAX ( 'Date Table'[Date] ) ) )
Best regards,- Anonymous6 years agoNot applicable
Unfortuantely it is still not correct.
If the Feb qty on hand = 206,656
And the total cumulative demand going into March is 16,662,
then the starting qty on hand for March should be
189,994
- v-lid-msft6 years agoCommunity Support
Hi Anonymous ,
We can modifify the Qty on Hand measure as following:
Qty on Hand or Surplus = VAR CurrentQty = CALCULATE ( SUM ( 'Items Bridge'[Quantity On Hand] ), FILTER ( ALLSELECTED ( 'Items Bridge' ), 'Items Bridge'[Item] IN FILTERS ( 'Items Bridge'[Item] ) ) ) RETURN SWITCH ( TRUE (), SELECTEDVALUE ( 'Date Table'[MonthOfYear] ) = MONTH ( MIN ( 'Items Bridge'[Last Gen Date] ) ), CurrentQty, SELECTEDVALUE ( 'Date Table'[MonthOfYear] ) > MONTH ( MIN ( 'Items Bridge'[Last Gen Date] ) ), CurrentQty - CALCULATE ( SUM ( 'Flu_PlanPegging'[Outstanding Requirement] ), FILTER ( ALLSELECTED ( 'Flu_PlanPegging' ), 'Flu_PlanPegging'[Item] IN FILTERS ( 'Items Bridge'[Item] ) // && 'Flu_PlanPegging'[Due Date] > MIN ( 'Items Bridge'[Last Gen Date] ) && 'Flu_PlanPegging'[Due Date] < Min ( 'Date Table'[Date] ) ) ),BLANK() )
Best regards,