• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

Power query creating duplicate rows after merging. The duplicate rows double each time I refresh the data.|Power Query|Excel Forum|My Online Training Hub

You are here: Home / Power query creating duplicate rows after merging. The duplicate rows double each time I refresh the data.|Power Query|Excel Forum|My Online Training Hub

vba course banner

Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumPower QueryPower query creating duplicate rows…
sp_PrintTopic sp_TopicIcon
Power query creating duplicate rows after merging. The duplicate rows double each time I refresh the data.
Avatar
Stanley George

New Member
Members
Level 0
Forum Posts: 2
Member Since:
September 12, 2020
sp_UserOfflineSmall Offline
1
September 12, 2020 - 10:56 am
sp_Permalink sp_Print

Hello All,

I'm getting duplicate rows every time i refresh my data. It doubles every time i hit refresh.

Following are the steps that i followed

1. I created a query from an excel table which was an existing query. 

2. I deleted some columns that i did not need.

3. I pivoted the data based on Sales order# and Price to get a unique list of Sales orders and aggregate price.

4. I loaded it into a new sheet. (Query name = summary)

5. I added 3 columns to the right hand side of the table called "comments", "actions" & "updates".

6. I made a connection of the table which includes the 3 new columns. (Connection name = self ref)

7. I edited "summary" and merged it with "self ref"

8. I expanded the tables to merge the 3 new columns to "summary"

9. I hit save and load.

The final product looked ok, and the comments are dynamic as i expected. However one sales order# which had 2 ship by dates and hence appeared twice in the table started doubling every time i hit refresh. I managed to solve this by editing the query and adding remove duplicates to the end. This stopped the doubling and removed the duplicates. However when i started entering comments and refreshing again a few other rows along with the previus culprot began to double again.

I am a beginner with power query, your inputs will be appreciated. 

 

Thanks

Stan

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1530
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
2
September 12, 2020 - 2:09 pm
sp_Permalink sp_Print

Hi Stan,

Please supply your workbook and query, and some source data.

Phil

Avatar
Mynda Treacy
Admin
Level 10
Forum Posts: 4518
Member Since:
July 16, 2010
sp_UserOfflineSmall Offline
3
September 12, 2020 - 2:40 pm
sp_Permalink sp_Print

Hi Stan,

If a query is returning duplicate data it's because it is referencing itself somewhere along the way. Either the original query is getting all data from the entire workbook, or your new query is. I recommend you check the source for each query to see which one is the culprit. If you get stuck, as Phil said, please supply the workbook containing the query.

Mynda

Avatar
Stanley George

New Member
Members
Level 0
Forum Posts: 2
Member Since:
September 12, 2020
sp_UserOfflineSmall Offline
4
September 14, 2020 - 10:11 am
sp_Permalink sp_Print

Thanks Phil and Mynda,

 

Turns out it was a case of duplicate entries causing the problem. I was trying to merge the two tables using the column with the duplicate entry.

I just added an index column after cleaning up the  data and merged the tables using the index column.

It is working fine now on my sample data. Lets hope that it works with the real data at work tomorrow.

Thanks once again for the prompt response.

 

Best regards

 

Stan

Avatar
Philip Treacy
Admin
Level 10
Forum Posts: 1530
Member Since:
October 5, 2010
sp_UserOfflineSmall Offline
5
September 14, 2020 - 10:30 am
sp_Permalink sp_Print

No worries Stan, glad you figured it out.

Regards

Phil

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Mohamed Jelle Hussein
Guest(s) 11
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 873
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 222
Jessica Stewart: 218
A.Maurizio: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
Aminu Sule
Samuel Ramirez
Abdifatah Osman
mohad borhom
Abayomi Adedeji
Ganesh MVS
Gilbert Lemek
Ashleigh Farquharson
Jayz Luu
Fred Smith
Forum Stats:
Groups: 3
Forums: 24
Topics: 6364
Posts: 27828

 

Member Stats:
Guest Posters: 49
Members: 32346
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.