Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Roger_EA
New Member

Inventory Forecast

Hi Bro 

 

 

I would like to create the ivnetory forecast base on the in and out record, how to create below report in PowerBI, please help and share the code to me, Thanks 
From Now on until the end of FY25 ( 31-Mar 2025)  

 

 Jul  End of Jul  End of Aug 
 Currently QtyInOutBalance QtyInOutBalance Qty
Item A50103030201040
Item B10302020601070

 

2 REPLIES 2
Anonymous
Not applicable

Hi @Roger_EA ,
Can you provide some sample data? We can better understand the problem and help you. 
How to provide sample data in the Power BI Forum - Microsoft Fabric Community
Or show it as a screenshot or pbix. Please remove any sensitive data in advance. If uploading pbix files please do not log into your account.
Please also show your desired results so we can help you better.

Best regards,
Albert He

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

rajendraongole1
Super User
Super User

Hi @Roger_EA -create two measure for in and outas per your requirement 

TotalIn =
CALCULATE(
SUM(InventoryTransactions[Quantity]),
InventoryTransactions[TransactionType] = "In"
)

 

total out  measure:

TotalOut =
CALCULATE(
SUM(InventoryTransactions[Quantity]),
InventoryTransactions[TransactionType] = "Out"
)

 

create a measure for balance forcast measure as below

BalanceQty =
VAR LastDate = MAX(Calendar[Date])
RETURN
SUMX(
VALUES(Items[Item]),
Items[CurrentQty] +
CALCULATE(
[TotalIn] - [TotalOut],
FILTER(
ALL(Calendar),
Calendar[Date] <= LastDate
)
)
)

 

Hope it helps to get the expected forcast. 

 

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.