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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mordonez
Frequent Visitor

Stock On Hand

Hello , im trying to archieve the following measure :

 

i need to calculate the actual stock in every month  , starting from a inicial stock adding the customers buy and substracting the customer sales : 

 i have the folowing tables :

 

sell in : are the products wich each reseller buy to my company  

sell out : are the sales from each reseller to final customer

inicial stock : the inicial stock in every product in every customer 

 

I can also attach a pbix with this example 

 

what i need to do is :

   date       customer        sku          Sell in      Sell Out                          Stock  

2020-02 | Customer1 | PROD001 |      0      |     273      | (previous month stock +sell in - sell out) 

 

 

 

inv test.png

3 REPLIES 3
amitchandak
Super User
Super User

@mordonez , You have use Intial stock + Cumalative Sell in - Cumalative Sell out

 

Qunatity on hand = [Intial stock] + CALCULATE([Sell in],filter(allselected(Date),Date[Date] <=max(Date[Date]))) -CALCULATE([Sell out],filter(allselected(Date),Date[Date] <=max(Date[Date])))

Hello , amit , can you check te answer i posted using your solution ??

This was Great!! very helpfull , just for  one detail : 

 

If in the moth i have no sell in , the cumulative sum repeats the last acumulated  value instead of sum 0

 

I created the tu cumulative measures , as you can see in the picture :

inv test.png

 

 

thanks @amitchandak 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors