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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
RFSOUW
Regular Visitor

Need help with Measure - get remaining inventory from another table

Guys,

 

Kindly help with the measure to get the total remaining quantity by Inventory status per shipment from another table.

Below is my scenario

 

RFSOUW_0-1738655629917.png

Greatly appreciate your inputs

1 ACCEPTED SOLUTION

@RFSOUW Yes you can

Remaining_Inventory =
CALCULATE(
SUM(Table2[Quantity]),
FILTER(
Table2,
Table2[Shipment_ID] = Table1[Shipment_ID] &&
Table2[Inventory_Status] <> "Sold" &&
Table2[Inventory_Status] <> "Reserved"
)
)

 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






View solution in original post

4 REPLIES 4
RFSOUW
Regular Visitor

Thanks

 

RFSOUW
Regular Visitor

Hi Bhanu,

 

Thanks. It works...if I can ask once more..if I have two statused I need to filter out (Sold & Reserved), can I simply add &&

 

Remaining_Inventory =
CALCULATE(
SUM(Table2[Quantity]),
FILTER(
Table2,
Table2[Shipment_ID] = Table1[Shipment_ID] &&
Table2[Inventory_Status] <> "Sold" && Table 2[Inventory_Status]<>"Reserved"
)
)

 

Thank you!

@RFSOUW Yes you can

Remaining_Inventory =
CALCULATE(
SUM(Table2[Quantity]),
FILTER(
Table2,
Table2[Shipment_ID] = Table1[Shipment_ID] &&
Table2[Inventory_Status] <> "Sold" &&
Table2[Inventory_Status] <> "Reserved"
)
)

 




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






bhanu_gautam
Super User
Super User

@RFSOUW 

First, ensure that you have a relationship between Table 1 and Table 2 on the Shipment_ID column.

Create a measure in Table 1 to calculate the remaining inventory

 

DAX
Remaining_Inventory =
CALCULATE(
SUM(Table2[Quantity]),
FILTER(
Table2,
Table2[Shipment_ID] = Table1[Shipment_ID] &&
Table2[Inventory_Status] <> "Sold"
)
)

 

Add this measure to your Table 1 to see the remaining inventory for each shipment.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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