Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
127 | |
76 | |
56 | |
41 | |
40 |
User | Count |
---|---|
206 | |
83 | |
73 | |
56 | |
51 |