- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Calculate inventory at running total
Hello everyone,
I tried to search for similiar topic in the forum but no solution to solve my issue. I really need some help from expert here.
I have table with OnHand stock at begining of the month and some in/out transaction monthly
I'd like to calculate stock by at begining of each month consider all transaction
SOH_ = SUMX(FILTER(ALL('Merge_table'),
'Merge_table'[Item] = EARLIER('Merge_table'[Item]) && 'Merge_table'[Plant] = EARLIER('Merge_table'[Plant]) && 'Merge_table'[Date] <= EARLIER('Merge_table'[Date])),
'Merge_table'[OnHand] + 'Merge_table'[In Transit] + 'Merge_table'[DistrReceipt (Conf)] + 'Merge_table'[Distr. Receipt (TLB)])
It seems right when with IN. However it mess-up when i include OUT
Whats wrong with my code here?
TIA 🙂
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@betty_bui2602 , Try have measure like
Inventory / OnHand
CALCULATE(firstnonblankvalue('Date'[Month]),sum(Table[Intial Inventory]),all('Date')) + CALCULATE(SUM(Table[Ordered]),filter(date,date[date] <=maxx(date,date[date]))) - CALCULATE(SUM(Table[Sold]),filter(date,date[date] <=maxx(date,date[date])))
Power BI Inventory On Hand
Power BI Inventory On Hand: https://youtu.be/nKbJ9Cpb-Aw
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

@betty_bui2602 , Try have measure like
Inventory / OnHand
CALCULATE(firstnonblankvalue('Date'[Month]),sum(Table[Intial Inventory]),all('Date')) + CALCULATE(SUM(Table[Ordered]),filter(date,date[date] <=maxx(date,date[date]))) - CALCULATE(SUM(Table[Sold]),filter(date,date[date] <=maxx(date,date[date])))
Power BI Inventory On Hand
Power BI Inventory On Hand: https://youtu.be/nKbJ9Cpb-Aw
If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hello @amitchandak I watched your vid and tried. But i dont get the result as what you did
SOH_Test return current month only

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
09-12-2024 11:07 AM | |||
07-11-2024 10:54 AM | |||
04-15-2024 01:44 PM | |||
07-23-2024 01:29 PM | |||
04-08-2024 08:50 AM |
User | Count |
---|---|
86 | |
73 | |
54 | |
43 | |
36 |
User | Count |
---|---|
98 | |
65 | |
54 | |
49 | |
45 |