Forum Discussion
Finding total value from previous month
I need to find the delta between total qty of current month to the total qty of the previous month.
So, I create PrevDate column to show previous month
I need to report the total quantity of the previous month
I use below formula but didn't get the result.
Please help
- Anonymous3 years ago
Hi Anonymous ,
I suggest you to try code as below.
PrevQty = VAR _item = MAX ( Inven[Item Number] ) VAR _date1 = MAX ( Inven[PevDate] ) VAR _date2 = MAX ( Inven[RT_YY_MM] ) VAR _result = IF ( _date1 = BLANK (), 0, CALCULATE ( SUM ( Inven[Quantity] ), FILTER ( ALLSELECTED ( Inven ), Inven[Item Number] = _item && Inven[RT_YY_MM] = _date2 && Inven[FileDate] = EOMONTH ( _date1, 0 ) + 1 ) ) ) RETURN _resultIf this reply still couldn't help you resolve your issue, please share a sample file with me.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- AnonymousNot applicable
Hi Anonymous ,
I suggest you to try code as below.
PrevQty = VAR _item = MAX ( Inven[Item Number] ) VAR _date1 = MAX ( Inven[PevDate] ) VAR _date2 = MAX ( Inven[RT_YY_MM] ) VAR _result = IF ( _date1 = BLANK (), 0, CALCULATE ( SUM ( Inven[Quantity] ), FILTER ( ALLSELECTED ( Inven ), Inven[Item Number] = _item && Inven[RT_YY_MM] = _date2 && Inven[FileDate] = EOMONTH ( _date1, 0 ) + 1 ) ) ) RETURN _resultIf this reply still couldn't help you resolve your issue, please share a sample file with me.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.