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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
deboec
Helper I
Helper I

Append 2 tables and remove dublicate rows

Hello guys,

 

I have two queries in my Excel file via connection.

Both queries are connected to tables with an identical structure (columns).

Only some of the rows are different.

 

I want to append query 1 with query 2 and only keep the rows which are unique. 
(So not only removce duplicates but also remove all rows that are not unique).

Query 1 and query 2 both have an index column.

1 ACCEPTED SOLUTION
Icey
Community Support
Community Support

Hi @deboec ,

 

Try this:

 

1. Append the two tables.

2. Group the appended table based on your requirements and add a "count" column to count rows at the same time.

3. Only keep the rows which "count"=1.

4. Expand the table.

 

 

Best Regards,

Icey

 

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

3 REPLIES 3
Icey
Community Support
Community Support

Hi @deboec ,

 

Try this:

 

1. Append the two tables.

2. Group the appended table based on your requirements and add a "count" column to count rows at the same time.

3. Only keep the rows which "count"=1.

4. Expand the table.

 

 

Best Regards,

Icey

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

CNENFRNL
Community Champion
Community Champion

@deboec , you might want to create a blank query

 

= Table.Distinct(#"query 1" & #"query 2")

 

 


Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension!

DAX is simple, but NOT EASY!

@CNENFRNL 
If I use this sintax the blank query basically only appends the two queries.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors