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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Cipriano
Helper III
Helper III

How to calculate inventory?

Hello, everyone,

 

It is necessary for me to perform the inventory calculation using the attached data set, but I do not know how to implement the second recursive DAX formula that uses the previous calculated inventory value.

 

In advance, thank you very much for your support.

 

 

ProductDateINOUTStockDAX
A28-ago-201000020607940Stock = IN -OUT
A29-ago-20028305110Stock = (IN + Stock Yesterday) - OUT
A30-ago-20019203190
A31-ago-2010000192011270
A01-sep-20019209350
A02-sep-20024906860
A03-sep-2020000328823572
A04-sep-200328820284
A05-sep-200328816996

 

1 ACCEPTED SOLUTION
PaulDBrown
Community Champion
Community Champion

See a solution in the other thread you posted:

 

https://community.powerbi.com/t5/Desktop/Como-calcular-el-inventario/m-p/2714090#M948254 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






View solution in original post

4 REPLIES 4
PaulDBrown
Community Champion
Community Champion

See a solution in the other thread you posted:

 

https://community.powerbi.com/t5/Desktop/Como-calcular-el-inventario/m-p/2714090#M948254 





Did I answer your question? Mark my post as a solution!
In doing so, you are also helping me. Thank you!

Proud to be a Super User!
Paul on Linkedin.






I really appreciate your valuable help, thank you very much.

tamerj1
Super User
Super User

Hi @Cipriano 
If your date column has only unique values then you do 

Stock =
VAR CurrentDate = TableName[Date]
VAR OnAndBeforeTable =
    FILTER ( TableName, TableName[Date] <= CurrentDate )
RETURN
    SUMX ( OnAndBeforeTable, TableName[IN] - TableName[OUT] )

I appreciate you, but it has different values.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Kudoed Authors