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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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

9 REPLIES 9
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 is hardly a solution, it might be a fix, but the issue that I ran up is that now I also get it when creating a new query... Is there some way to access the query data?

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

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.