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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
RafaelAri
Helper III
Helper III

Merging 2 different tables

Hello experts,

Attached is an Excel file with an example of what I need:

I have 2 data tables,

1) A list of items quantities in different warehouses

2) A list of purchase orders of items, each item can have several PO's.

The requirement is to present in "Table" visual a list of items whose total quantity in warehouses is "0" and for each such item the total quantity available for it in procurement (if there is no procurement then "0").
Thank you very much for any help

WH's Inventory
WH NameItem No.Item Name Qty. in WH
WH1Item1Name10
WH2Item1Name110
WH1Item2Name25
WH2Item2Name20
WH3Item2Name21
WH1Item3Name30
WH1Item4Name40
WH1Item5Name50
WH2Item5Name50
WH1Item6Name62
WH2Item6Name67
WH3Item6Name60
WH1Item7Name70
WH1Item8Name80
WH2Item8Name80
    
PO's Balance
PO No.Item No.Item Name Qty. on Purchase
PO1Item1Name18
PO2Item1Name17
PO3Item2Name25
PO4Item4Name46
PO5Item4Name43
PO5Item6Name610
PO5Item8Name820
PO6Item8Name810
PO6Item9Name92
PO6Item10Name106
PO6Item11Name113
    
Visual Table
Item No.Item Name Qty. in WH's Qty. on Purchase
Item3Name300
Item4Name409
Item5Name500
Item7Name700
Item8Name8030
1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@RafaelAri 

You can create and Items table that will sit above Warehouse and PO and link to them both based on Item No.

This is the DAX code for the new table.

Items = 
DISTINCT(
    UNION ( 
        SUMMARIZE('Warehouse Inventory','Warehouse Inventory'[Item No.],'Warehouse Inventory'[Item Name]),
        SUMMARIZE('PO Balance','PO Balance'[Item No.],'PO Balance'[Item Name])
    )
)

Then you link it to the other tables in the model:

jdbuchanan71_0-1698675540782.png

Then a couple of mesures to sum the amounts from Warehouse and PO.

Qty. in WH's = SUM ( 'Warehouse Inventory'[Qty. in WH] )
Qty. on Purchase = SUM ( 'PO Balance'[Qty. on Purchase] )

 

Add the item number and name from the Items table and the meausres to get the counts then set the fitler on the table to [Qty. in WH's] = 0

jdbuchanan71_1-1698675657892.png

I have attached my sample file for you to look at.

 

View solution in original post

2 REPLIES 2
RafaelAri
Helper III
Helper III

Thank you very much for your help 👌

jdbuchanan71
Super User
Super User

@RafaelAri 

You can create and Items table that will sit above Warehouse and PO and link to them both based on Item No.

This is the DAX code for the new table.

Items = 
DISTINCT(
    UNION ( 
        SUMMARIZE('Warehouse Inventory','Warehouse Inventory'[Item No.],'Warehouse Inventory'[Item Name]),
        SUMMARIZE('PO Balance','PO Balance'[Item No.],'PO Balance'[Item Name])
    )
)

Then you link it to the other tables in the model:

jdbuchanan71_0-1698675540782.png

Then a couple of mesures to sum the amounts from Warehouse and PO.

Qty. in WH's = SUM ( 'Warehouse Inventory'[Qty. in WH] )
Qty. on Purchase = SUM ( 'PO Balance'[Qty. on Purchase] )

 

Add the item number and name from the Items table and the meausres to get the counts then set the fitler on the table to [Qty. in WH's] = 0

jdbuchanan71_1-1698675657892.png

I have attached my sample file for you to look at.

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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