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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
AliNafa
Frequent Visitor

Inquiry about calculating stock on hand level based on sales , Purchase , etc.

Hi ,

I would like to calculate the stock on hand based on Inovice type which can be Sales , Purchase , IN or OUT.

wheres:
( CO_ ID ) : Represents the fisical year number.
( WH_ID ) : Warehouse ID number.
( ITEM_ID ) : Item number on the system.
( BEG_QTY ) : The Opening quantity for the item on the fisical year.
( QTYSold ) : Number of Pcs sold for an order.
( INV_ID ) : Invoice number.
( INV_DATE ) : Invoice Date.
( INV_TYPE ) : We have 3 invoice types :
( 5 ) Represents Sales , Which means we will need to decress the amount of QTY.
( A ) Represents IN , Which means we will need to incress the amount of QTY.
( B ) Represents OUT, Which means we will need to decress the amount of QTY.

We have two table , The first table is for the ITEM :


ITEMS.jpg

And this is the second table for Invoice Transaction :

INV_TRAN_DUMMY2.jpg


The expected result should look like this after creating the correct relation between the two tables and making the Dax command :

Expected Result for Power Bi.jpg

You can download the PPIX file from the link below , I hope everything is clear and let me know if you need more clarifications.

https://drive.google.com/file/d/14cqCNBH4xip55VqQu5nP0_Wcn9MpAUKS/view?usp=sharing

Thank you !

2 REPLIES 2
AliNafa
Frequent Visitor

Hi @daXtreme 

I have reviewed all the posts and non of them have helped with my proplem

Thank you.

daXtreme
Solution Sage
Solution Sage

There are many posts on this forum that deal with "Stock on Hand." Here are some of them:

Search - Microsoft Power BI Community

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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