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
DataGuy2016
Advocate II
Advocate II

Table Merge creates duplicate records

Hi Folks,

 

I am stumped.

 

I am trying to merge two tables into a new table using a LEFT JOIN.  Both tables have unique records on each row.  When I join the tables, BI creates duplicate rows on some records for no apparent reason.  The duplicates are identical in every way.

 

Can anybody explain this?  Is this a bug?

1 ACCEPTED SOLUTION
DataGuy2016
Advocate II
Advocate II

The problem lay with the Data.

 

The LEFT JOIN functionality of PowerBI works perfectly.

View solution in original post

46 REPLIES 46

Hi @DataGuy2016

 

If you haven't already found a solution...

 

I had a similar issue where LEFT JOIN was creating duplicates, resulting over 1000 rows of data where I should have just 85.

 

I solved the issue by expanding the relative columns as an aggregate, instead of just an expansion.

 

Hope that this makes sense.

 

 

 

 

 

Anonymous
Not applicable

I am having the same problem with my data.  And no, I do not understand your answer to "expand as an aggregate," will you please clarify?

 

I know this is an old thread, but if someone else is still reading this thread and would like to offer help, I appreciate it!

 

 

Anonymous
Not applicable

HI JR,

 

Thank you for the response.  Could you send me an email at trossgreene@stormsmart.com.  I want to talk with you more and share a sample file, but I can't figure out how to upload an excel file here.

 

Thanks,

 

Tera

Hi @Anonymous, 

 

I have created a quick sample that I hope helps explain my method. It may not work with your data, but it did fix the issue with mine!

 

I have two tables, I would like to merge 'Customer Type' with 'Customer Name'.

 

Customer Name TableCustomer Name Table

 

Customer Type TableCustomer Type Table

 

I would like to merge using the 'ID' column in both, to bring in the 'Cust Type' field from table 'Customer Type' into table 'Customer Name'.

 

 

 Merge OptionsMerge Options

 

 

Once successfully merged, I see the below:

6.JPG

 I now have the option to expand that column of the merged table to bring in data from the 'Customer Type' table. But this is where I choose to Aggregate a field rather than expand. You may require a different aggregate measure other than median, dependant on data type:

 

Expand as AggregateExpand as Aggregate

 

The result from my data is below:

 

ResultResult

 

Please also see sample.pbix file which I hope can help you with your issue.

Hi,

 

The LEFT JOIN table Merge is creating duplicate records from the LHS table. 

 

I understand what a LEFT JOIN is. 

 

My LHS table only has unique rows.  Why is PowerBI creating duplicate records?  These are 100% identical in every respect.

 

 

 

SQL JOINSSQL JOINS

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.