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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
tslyonsnj
Frequent Visitor

calculated column from other tables

I have a parts table ("Parts" - key is Part Number) for a marine services shop, and would like to create a column documenting current inventory from two sources - a "Supplier Invoice Detail" table which logs supply of parts into the shop, and a "Work Order Detail" table which logs uses, or decrements to inventory as parts are used.  Both detail tables carry "Part Number".

 

I have One-to-Many relationships between "Parts" and the two detail tables, so was expecting the Filter context to be carried into the detail tables and thus return the sum of Qty from just the rows containing the current Part Number.  

 

Current Inventory = (SUM('Invoice Line Item'[Qty]))-(SUM('Work Order Line Item'[Qty]))

 

I know my problem is with the filter context not working as I envision, but am at a loss and would appreciate any guidance.

 

Thanks.

1 ACCEPTED SOLUTION
v-chuncz-msft
Community Support
Community Support

@tslyonsnj,

 

You may use RELATEDTABLE.

https://docs.microsoft.com/en-us/dax/relatedtable-function-dax#example

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@tslyonsnj,

 

You may use RELATEDTABLE.

https://docs.microsoft.com/en-us/dax/relatedtable-function-dax#example

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.