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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
nmoriello
Frequent Visitor

Shippable Inventory Dax & Matrix

Hello,

I have a Power BI Report that is using 4 different tables (Order Backlog, Inventory, Incoming Shipments & Production) I am trying to leverage all 4 tables to see what amount of inventory to fulfil my "Order Backlog" orders. I currently have a Dax measure that looks like this: 

 

Shippable Qty Total =
VAR BacklogQty = [YTD Qty Total]
VAR OnHandQty = SUM('Total On Hand Qty'[OnHandQty])
VAR IncomingQty = SUM('Total CZUB Shipments'[Qty])
VAR ProductionQty = SUM('Total Unit Production'[Calculated_Qty])
VAR TotalAvailableQty = OnHandQty + IncomingQty + ProductionQty
RETURN
MIN(BacklogQty, TotalAvailableQty)
 
It seems to be doing the correct calculations from a bottom row level basis. But once I put it into a matrix and stack some categories on top of the Part Numbers in each row such as Part Cateogry & Company then the calculation doesnt add up. For example in the screenshot below, the numbers under that 21,004 do not add up correctly. It should be displaying 20,356. I am not sure where the disconnect is coming from, it seems to be doing the correct calculation at the row level, but one the top level of the matrix is loses it. Any help would be great!
 
nmoriello_2-1729792995737.png

 


 


 

5 REPLIES 5
parry2k
Super User
Super User

@nmoriello try this, if not It will be easier if you share pbix file using one drive/google drive with the expected output. Remove any sensitive information before sharing.

 

 


Shippable Qty Total =
SUMX ( 
   ProductTable,
   VAR BacklogQty = [YTD Qty Total]
   VAR OnHandQty = CALCULATE(SUM('Total On Hand Qty'[OnHandQty]))
   VAR IncomingQty = CALCULATE(SUM('Total CZUB Shipments'[Qty]))
   VAR ProductionQty = CALCULATE(SUM('Total Unit Production'[Calculated_Qty]))
   VAR TotalAvailableQty = OnHandQty + IncomingQty + ProductionQty
   RETURN
   MIN(BacklogQty, TotalAvailableQty)
)

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@nmoriello can you share relationship diagram and what columns you are using on the rows.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Since I have multiple Companies on each table I created a unique link (PartNum Link). That each table in the diagram below is linking to the Part Table. That allows me to geat to each part from the tables.

 

As for the Matrix I am using the PartNumber as the bottom value, then above that I am using a PartCategory field that lives on that same Part Table.

nmoriello_0-1729882162814.png

 

parry2k
Super User
Super User

@nmoriello try this:

 

Shippable Qty Total =
SUMX ( 
   VALUES ( productTable[Product] ),
   VAR BacklogQty = [YTD Qty Total]
   VAR OnHandQty = CALCULATE(SUM('Total On Hand Qty'[OnHandQty]))
   VAR IncomingQty = CALCULATE(SUM('Total CZUB Shipments'[Qty]))
   VAR ProductionQty = CALCULATE(SUM('Total Unit Production'[Calculated_Qty]))
   VAR TotalAvailableQty = OnHandQty + IncomingQty + ProductionQty
   RETURN
   MIN(BacklogQty, TotalAvailableQty)
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi Parry2k,

 

That unfortunetly didnt work, it doesnt look like its even calculating the row level correctly with the SUMX and VALUES.

 

 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

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

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors