Forum Discussion
Power Query Doubling some fields after creating key and merging queries.
I have two queries in Power Query that I need to join together. I have created a key so each state has its own number. When I merge my Crop Report Query with my Harvested Query some states doubled up with different data coming from somewhere? My code below was filtered down to a single state that is showing the problem.
5 Replies
- SergeiBaklanDiamond Contributor
Fields could be doubled if keys are not unique. However, it's better to discuss on the sample - unique or not keys, which kind of join, etc
- joelraysonCopper ContributorSo as far as i know the key is unique. I made a separate query with each state and then added an index column 1 to 50. Added that key to both Harvested and Crop Report and then joined with inner.
- SergeiBaklanDiamond Contributor
It looks like duplication of https://techcommunity.microsoft.com/t5/excel/power-query-doubling-some-fields-after-creating-key-and-merging/m-p/4228920
But why do you need State ID if could merge by State Name. If ID, are they exactly the same for each state in all tables? By the way, you have left join, not inner join.