Forum Discussion
afaque03
9 years agoHelper I
Calculate On Hand quantity
Hello Freinds, I have a matrix table where im showing month wise incoming and outgoing quantity and there is a filter of month. I want to calculate On-Hand quantity for the selected month. My rep...
- 9 years ago
Hi afaque03,
My mistake.
Could you try the formula below to see if it works? :smileyhappy:
On-Hand Quantity = VAR currentYearMonth = MAX ( 'Table1'[YearMonth] ) VAR productName = FIRSTNONBLANK ( 'Table1'[Product Name], 1 ) RETURN CALCULATE ( SUM ( 'Table1'[Incoming Quantity] ) - SUM ( 'Table1'[Outgoing Quantity] ), FILTER ( ALL ( Table1 ), 'Table1'[YearMonth] <= currentYearMonth - 1 && 'Table1'[Product Name] = productName ) )Regards
v-ljerr-msft
9 years agoMicrosoft Employee
Hi afaque03,
Great to hear the problem got resolved! Could you accept the corresponding reply as solution to close this thread? :smileyhappy:
Regards
afaque03
9 years agoHelper I
v-ljerr-msftSure. Thnx again :smileyhappy: