March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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.
@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.
@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.
Hello @amitchandak I watched your vid and tried. But i dont get the result as what you did
SOH_Test return current month only
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
143 | |
97 | |
79 | |
68 |