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

View all the Fabric Data Days sessions on demand. View schedule

Reply
rainchong7401
Helper III
Helper III

Find Matching from Multiple Relationship Table

Hi Guys,
I'm new to Power BI
I hope anyone of you could help me out. 

Table 1 is my item ordered quantity.
Table 2 is my transaction table which need to make sure quantity is received correctly to tally with Table 1 quantity.

Just want to ask you guys it is possible.
Expected output:
I want to sum received quantity (table 2) and match table 1 , SO-1, Item 1, quantity 230  
If table 2 sum of received quantity 230 based on item 1 match table 1 qty 230 
Return the MAX DATE of Partial delivery date 1/3/2022 in Table 1. 

It's complicated I hope someone can advise and provide code if you know. 

rainchong7401_0-1663729879856.png

 

3 REPLIES 3
tamerj1
Super User
Super User

Hi @rainchong7401 
I guess the two tables are related one-many? If so please use

Partial delivery =
VAR RelatedTable2 =
    RELATEDTABLE ( Table2 )
RETURN
    IF (
        SUMX ( RelatedTable2, Table2[Received Quantity] ) = Table1[Received Quantity],
        MAXX ( RelatedTable2, Table2[Partial delivery date] )
    )

Hi Tamerj,
This is many many relationship. 
Table 1 primary key is SO
Table 2 primary key is SO too.

@rainchong7401 
Should also work

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors