Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
scott_s
Frequent Visitor

Duplicating query leads to "Item has already been added" error and corrupted file

I have a recurring issue across multiple PBIX files and multiple machines over last few weeks.  It usually surfaces as I am in Power Query and right click and select Duplicate on an existing query.  I get the error message

 

"

Something went wrong

 

Item has already been added.  Key in dictionary: '[existing query name]' Key being added '[existing query name]'

"

 

I can add a blank query at this point and copy/paste code in but the damage to the file is done.   After i save, the next time I try to open the file I will get this error:

 

"

Unable to open document

 

'C:\[path to file]' can't be opened.  Either fthe file is encrypted or corrupted.

"

 

I thought this issue might have to do with my recent decision to have my pbix files in a OneDrive folder for version history.  One computer has done better now that I develop locally.  But today I got the message on another machine after I moved the file out of OneDrive to a non-synced local folder.

 

My only recourse is to go back to a previously saved version and redo my transformation work.   Since I'm not on OneDrive I have to keep doing File - Save As to new filename to prevent loss of much work next time this happens.

 

This is on Version: 2.108.997.0 64-bit (August 2022)   

 

Any ideas how to address?  This is a serious productivity issue.

1 ACCEPTED SOLUTION

Now, every time I need to duplicate or reference an existing query I take a different approach than using the context menu.  I just creating blank queries and write or copy the M code in advanced editor to duplicate or reference the query I want to build on.  I have done this about 10 times over last few days and haven't had any further issues.

View solution in original post

8 REPLIES 8
katiestockford
Regular Visitor

I am getting the issue where the PowerBI file keeps corrupting after the above error message appears.

 

Is this a PowerBI issue? I am not doing anything different to the queries and it seems random when it chooses to corrupt.

It seems random for me but once it starts happening, and I revert to old file, it is more likely to happen again. 

For now I am trying to side-step the issue by just creating blank queries and using code in advanced editor to duplicate or reference the query I want to build on.  I just started this today so I don't know if this will work long term or some other function will cause the same issue.

It appears to be a large query I have that causes it to break but it doesn't have anything wrong with the query itself so is very odd. Let me know if that solution works.

Have you had any success yet Scott?

Now, every time I need to duplicate or reference an existing query I take a different approach than using the context menu.  I just creating blank queries and write or copy the M code in advanced editor to duplicate or reference the query I want to build on.  I have done this about 10 times over last few days and haven't had any further issues.

This worked great, thank you!

scott_s
Frequent Visitor

Thanks.   No windows updates are pending.  On my personal PC I did reinstall Power BI a few weeks back when this happened.  For a couple hours I was able to work but the issue eventually re-occurred.  On my work computer I don't have permission to reinstall so I can't try that but my experience on my personal PC leads me to believe reinstalling isn't a solution.

amitchandak
Super User
Super User

@scott_s , Make sure no windows update is pending. Install update. reinstall power Bi and try.

 

If needed revert to Jul 2022 and check https://docs.microsoft.com/en-us/power-bi/desktop-latest-update-archive

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.