cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
HZAFAR
Regular Visitor

Power Query

Hi Expert

 

I am working in Power Query on Data ( more than 3 sheets). And I am using one file date as base file and want to bring column information from other sheets by using Unique Key. I have below challenges

1- in base file and other files, unique Key have duplicates key, his to fix it

2 - while using merge query, due to duplicates lines, lookup data total quantity is not correct, 

3- Hie to use Simif query to overcome total of qty from other sheets

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @HZAFAR 

 

It depends on how you want to deal with the data in other columns in the base table. If you don't care about data in other columns, you can select Unique Key column and use Remove Rows > Remove Duplicates to remove duplicated values so it will be unique. 

vjingzhang_0-1651225734526.png

 

If you want to aggregate data in other columns, you can try the Group By feature. Group by Unique Key column and get aggregated values of other columns. Then data in Unique Key column will be unique. Group By can also help do some sumif operations.

 

Once Unique Key column only has unique values, you can merge queries then. 

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

PhilipTreacy
Super User
Super User

Hi @HZAFAR 

 

Well, if your Unique ID isn't actually unique then the way to fix that would be to go to the system that creates these ID's and make them create unique ones.

 

If you try to bring the data into PQ and are getting issues due to duplicated 'Unique' ID's then I guess you could create your own Index column(s) which would be unique for each record, across all tables.  

 

Beyond that advice it's hard to say anymore without seeing your data.  Can you please suply some samples.

 

How do you intend to merge queries?  What fileds are to be merged/kept?  Are you actually merging files or appending them?

 

Please supply an example of what you want as a result of all of this.

 

regards

 

Phil



Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


Blog :: YouTube Channel :: Connect on Linkedin


Proud to be a Super User!


Helpful resources

Announcements
September Update

Check it Out!

Click here to learn more about the September 2022 updates!

Power BI Show episode 9

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power BI Dev Camp Session 25

Ted's Dev Camp - August 25, 2022

Watch Session 25 of Ted's Dev Camp.

Top Kudoed Authors