Forum Discussion
rajasekar_o
2 years agoHelper V
opening quantity closing quantity calculation
hi team, need help for calculating inventory opening quantity and closing quantity with out date beet ween date selection opening quantity and closing quantity correctly showing if i select an...
Jihwan_Kim
2 years agoSuper User
Hi,
I am not sure how your semantic model looks like, but I tried to create a sample pbix file like below.
Please check the below picture and the attached pbix file.
In quantity: =
SUM( Data[In qty] )
Out quantity: =
SUM( Data[Out qty] )
WINDOW function (DAX) - DAX | Microsoft Learn
Opening quantity: =
CALCULATE (
[In quantity:] - [Out quantity:],
WINDOW (
1,
ABS,
-1,
REL,
ALL ( 'Calendar'[Date] ),
ORDERBY ( 'Calendar'[Date], ASC )
)
)
Closing quantity: =
[Opening quantity:] + [In quantity:] - [Out quantity:]
- rajasekar_o2 years agoHelper V
its not showing correct quantity
- Jihwan_Kim2 years agoSuper User
please share your sample pbix file, and then I can try to look into it.
thanks.