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
bassplayer-nld
Regular Visitor

Calculate months of inventory

Hello
I want to calculate months of inventory based on a total for a specfic part number. There are two ways I get inventory in. Either by "in transit shipment" or by means of a "PO shipments". The total of both table can be empty. How do I calculate with those empty values.

MOS = (
SUM('Inventory OnHand'[Quantity On Hand]) - SUM('Inventory OnHand'[Unreserved Qty]) + (SUM('PO Shipments'[Open Qty]) + SUM('In Transit Shipments'[Quantity]))
 
I am using the outcome of the above calculation to calculate the months of stock:
MOS divided by Moving 6 Mth Avg Adj History =
DIVIDE([MOS], SUM('Copper Cable DK'[Moving 6 Mth Avg Adj History]))
2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @bassplayer-nld 

 

Can you provide some of the example data? Sensitive information can be removed in advance. What kind of expected results do you expect? You can also show it with pictures.

 

Best Regards,

Community Support Team _Charlotte

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

amitchandak
Super User
Super User

@bassplayer-nld ,The information you have provided is not making the problem clear to me. Can you please explain with an example.

 

Usually, we build inventory using cumulative

 

example

Inventory / OnHand
[Intial Inventory] + CALCULATE(SUM(Table[Ordered]),filter(date,date[date] <=maxx(date,date[date]))) - CALCULATE(SUM(Table[Sold]),filter(date,date[date] <=maxx(date,date[date])))
Appreciate your Kudos.

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
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.