Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
Hey all,
here is my calculated column.
accumulated Stock =
calculate(
sumX('Goods logistics','Goods logistics'[Stock]),
FILTER(All('Goods logistics'),
And('Goods logistics'[Stock ID]=EARLIER('Goods logistics'[Stock ID]),
'Goods logistics'[Date]<=EARLIER('Goods logistics'[Date])
)))
It works fine until I have multiple outputs in a day. As an example, there are three outputs on August 13, 2022. The only correct thing here is the final score of -4. I wrote down the expected subtotals. Where is my misconception?
I calculated the 'stock' column in Power Query with 'Input' minus 'Output'.
Here is the sample:
Thank you for help.
Solved! Go to Solution.
@azaterol , try document number in place of date
accumulated Stock =
calculate(
sumX('Goods logistics','Goods logistics'[Stock]),
FILTER(All('Goods logistics'),
And('Goods logistics'[Stock ID]=EARLIER('Goods logistics'[Stock ID]),
'Goods logistics'[Document No]<=EARLIER('Goods logistics'[Document No])
)))
@azaterol , try document number in place of date
accumulated Stock =
calculate(
sumX('Goods logistics','Goods logistics'[Stock]),
FILTER(All('Goods logistics'),
And('Goods logistics'[Stock ID]=EARLIER('Goods logistics'[Stock ID]),
'Goods logistics'[Document No]<=EARLIER('Goods logistics'[Document No])
)))
@amitchandak Doc Nr is fine, works great. With creating an index in power query I get more success! Anyways thank you.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!