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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Rnaval
Post Patron
Post Patron

Need help combining two worksheets

I have two worksheets. The second worksheet contains data that are not in the first worksheet (IP addresses) which I would like to identify and then append to the first worksheet. In Excel, using the second worksheet, I search for the IP Addresses that are not found in the first worksheet and then copy and append all of those rows to the first worksheet. I would like to do this in Power BI / Power Query so that I can automate / schedule this.

4 REPLIES 4
cengizhanarslan
Super User
Super User

1) Load both worksheets into Power Query

2) Make sure the IP Address columns have the same data type in both tables

3) In Worksheet2, do Merge Queries

4) Match Worksheet2[IP Address] to Worksheet1[IP Address]

5) Choose join type: Left Anti

  • This returns only rows from Worksheet2 that do not exist in Worksheet1

6) Append that result to Worksheet1

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.

Thanks, how do I perform step 6, is there an option to Append or manually copy and paste to Worksheet1?

Merge and Append can be done pretty easily through the PQ UI.

 

For Merge, you just need to make sure your Unique ID's truly match...same type and same string.

 

For Append, you ideally want both tables to have columns that match. They don't need to match perfectly, but it starts getting a little weird with how columns get ordered if there aren't a perfect match.

 

flowingbuckle_0-1773253908024.png

 

You can Merge or Append into an existing query, or create a new one.

 

I recommend creating a new one, and then changing the queries that are the source of the Merge/Append to a Connection Only that isn't actually loaded.

m_dekorte
Resident Rockstar
Resident Rockstar

Hi @Rnaval,

 

You can try a pattern like this.
This assumes you have two tables in 1 excel workbook, the first table is called _t1 and the second (the table to append to the first) is called _t2. Both these tables have at least 1 column called IP address 

let
    t1 = Excel.CurrentWorkbook(){[Name="_t1"]}[Content],
    t2 = Excel.CurrentWorkbook(){[Name="_t2"]}[Content],
    r = Table.Combine(
        {
            t1,
            Table.RemoveMatchingRows(t2, Table.ToRecords(t1), {"IP address"})
        }
    )
in
    r

 

Or simply append both tables and remove duplicates from the IP address column...
I hope this is helpful

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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