Forum Discussion
DataGuy2016
9 years agoAdvocate IV
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...
- 9 years ago
The problem lay with the Data.
The LEFT JOIN functionality of PowerBI works perfectly.
GenericUsername
8 years agoRegular Visitor
I just ran into the same problem and fixed it by joining the two tables on multiple fields. For example, let's say a transaction number is the unique field you are joining on, expand the join to include other fields if possible. So your joins would be on transaction number, time, and amount.
MS1986
8 years agoRegular Visitor
Yes, that's what I've done too. However, even that solution created some duplicates as we don't have a one to one mappings in some cases. The only solution I could come up with (and one that would've slow down the query significantly) was to remove duplicates against the columns which then were used in merge. To make sure there's only one line per particular combination of columns. It's similar to how vlookup works. It brings up only the first occurrence for duplicates. However, since I'm new to PQ there might be things which I am not aware of. Thus waiting for some more experienced users to chip in.