Forum Discussion
Getting Random Duplicates after Merge and Expand
I'm using Merge (left outer) on two fields with Expand column, my right side is unique (Check with SQL including case sensitive collation).
Before I expand I don't get duplicates, after I expand I get duplicates, however the duplicates rows are identical (using all columns from right side) and appear to be random as after refreshing the table I get different duplicates each time.
I have also sorted data in Power Query as final step, and when I look at the duplicated ID, it actually isn't duplicated, but is duplicated in Power BI Report.
Applying remove duplicates solves the problem, but I'm trying to understand why merge with expand would produce duplicates. The table is 100k+ rows.
Any ideas?
Regards
Emil
7 Replies
- v-huizhn-msftMicrosoft Employee
Hi _Emil_,
The date in left side have duplicate, right? If it is, I try to reproduce the scenario, please review the following.
The first table is left side table, the second is right side table which is unique.
I merge(left outer) on two tickets, and result as the screenshot below.
From the result, I get duplicates after expand. This is because there are duplicates, the value in right site must matches them.
If you have any other issue, please feel free to ask.
Best Regards,
Angelia- _Emil_Advocate II
Hi Angelia,
Let me clarify, using your example you have 5 rows on left side, and you get 5 rows as final result, in my case I get 5+ rows, even when right side is unique.
So my output is like this:
1. D, D
2. D, D
3. C, C
4. E, E
5. E, E <-- duplicated
6. F, NULL
and if I refresh data my duplication would be different like this:
1. D, D
2. D, D
3. C, C
4. C, C <-- duplicated
5. E, E
6. F, NULL
I have this beheviour on several different merges now, in all cases right side is unique, so I don't expect to get more rows on left side, but I do.
If I take my duplicated row and filter my left side (1 unique row) than I no longer get the duplication, and if I was doing something wrong (which is possible) I would expect it to be there duplicated.
I'll try to play with it a bit more to see if I can narrow down the issue.
Regards
Emil
- v-huizhn-msftMicrosoft Employee
Hi _Emil_,
For your requriement, it should change dynamically. We are unable to achieve your expected result. Thanks for your understanding.Best Regards,
Angelia
- vpecherskyNew Member
Where you able to find a solution to this? I'm having this problem when merging a large CSV and a large XLS.