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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Simulating scrapped inventory value

Hello, 

 

I am attempting to build a visual involving simulated scrapped inventory value. I have raw material expiration date information and consumption patterns, what i would like to do is simulate how much raw material will be scrapped based on the current consumption pattern. Below is the sample data.

 

Table 1 contains expiry date information of the raw material of different batches and its value plus stock on hand. 

Table 1:

Operative Stock Days = (Stock on Hand / Average monthly consumpion) * 30 days

 

Part NoExpiry DateBatch No.Value Unit CostStock on HandOperative Stock Days
A3/1/20211 $  22,500.001.515000225
A7/2/20212 $  22,650.001.5115000225
A11/2/20203 $  14,900.001.4910000150

 

Table 2 contains the following information:

 

 

Part NoStock On HandAverage Monthly Consumption (L12M)
A400002000

 

What i would like is an output of Table 3:

 

Highlighted in red indicates my desired output

 

Part NoExpiry DateBatch No.Value Unit CostStock on HandOperative Stock DaysDate of consumptionDays to expiryMaterial RemainingScrapped Inventory Value
A11/2/20203 $  14,900.001.49100001507/20/2020105.003000.00 $                                 4,470.00
A3/1/20211 $  22,500.001.51500022511/3/20201187133.33 $                               10,700.00
A7/2/20212 $  22,650.001.51150002253/2/20211226866.67 $                               10,368.67

 

Important parameters to consider:

1. First in first out applies. Oldest batch with earliest expiry date will be consumed first.

2. For the date of consumption, the batch with the earliest expiry date is always today's date. Therefore it is important to identify the first batch for each part number.

3. The second batch with the next expiry date in line will theoretically start consuming when the first batch has been consumed completely (operative stock days becomes zero) or it has expired (the day after expiry date). This will apply until all batches has been consumed, or expired. 

4. Assume that the average monthly consumption does not change.

 

How to arrive at material remaining:

Since we quantify the consumption of raw materials in days, and we are always looking at days to expiry, therefore i thought it is easier to calculate material remaining by days.

Operative Stock Days = (Stock on Hand / Average monthly consumpion) * 30 days

Operative Stock Days - Days to Expiry = Days Remaining. 

Material remaining = (Days Remaining / 30) * average monthly consumption 

Scrap inventory value = Material remaining * unit cost. 

 

The way i figured is: 

The formula needs to first identify which is the first batch, and assume today's date. Then it needs to calculate whether based on the operative stock days, will it be completely consumed or will there be any material left for expiry. If the material is completely consumed, then the second batch (assuming there is one) will start consuming on the day after the first batch is consumed. If there is material left for expiry from the first batch, then the second batch will start consuming on the day after the first batch is expired. 

 

This is the logic i have come up with. I would appreciate if anyone can show me how to visualize this, or come up with a better solution. 

 

Thanks!

 

 

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , refer if this can help

https://radacad.com/dax-inventory-or-stock-valuation-using-fifo

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.