Forum Discussion
Question re merging queries in power query
Hi I have a question re merging queries.
I have two tables in power query and want to merge them. T1 has say 5 rows and T2 has 10 rows.
I want to add a field from T2 to T1, using a common ID. I merge using Left Outer (all from first, matching from second).
However when I join and expand the variable from T2 that I wanted in T1 I generate lots of duplicate rows. I only wanted to populate the original T1 5 rows - and assumed that when I expand this is what would happen.
I can get rid of the duplicates but can anyone tell me if I am doing anything wrong?
Thanks,
A
5 Replies
- Mariusz
Community Champion
- Mariusz
Community Champion
Hi adavid999
If you merging tables you have two choices when expanding default will expand all the matching rows from the second table or you can aggregate where you have to specify sum or count aggr of available column.
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
LinkedIn - amitchandak
Super User
adavid999 , do you have a key column to join and make sure row are not duplicating.
These are two option for merge
https://radacad.com/append-vs-merge-in-power-bi-and-power-query
https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/
Prefer the first option.
- adavid999
Helper V
Thanks for replies and apologies, it was because it is not 1 to 1, there are multiple instances of T1 join field in T2, coffee not kicked in yet!
A
- v-xuding-msft
Community Support
Hi adavid999 ,
Can you share some sample data and your expected output? We will understand more clearly and resolve it quickly.