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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
PhilSmith23
New Member

the given key was not present in the dictionary from new query

Hey Folks,

I have one query that I create: It previews fine, (runs elsewhere fine,) but Close and Apply gives me that error.  Latest version of BI, (did it in the previous version as well,) 90% of the queries come from the exact same source, (a MySQL database), I have no measure-only tables.  The query is clean, with no transformations.  I have not seen anything else online that seems to apply.

 

Anything else I should be looking for?

 

Thanx

 

Phil

 

 

1 ACCEPTED SOLUTION
v-sgandrathi
Community Support
Community Support

HI @PhilSmith23,

 

To address the “The given key was not present in the dictionary” error in Power BI, begin by duplicating the query in Power Query Editor. Right-click the query causing issues, select "Duplicate," rename it, and remove any relationships with other tables. Use “Close & Apply.” If this version loads successfully, the issue is likely due to model dependencies. Then, remove all dependencies from the original query, including measures, calculated columns, or relationships, and try “Close & Apply” again.

Also, clearing Power BI’s cache can help, as it may contain outdated metadata. Navigate to File > Options and Settings > Options > Data Load > Clear Cache. If the error persists, consider creating a SQL view in MySQL (e.g., vw_MyWorkingQuery) with a consistent set of columns and import that view into Power BI instead of using the raw query. This ensures Power BI receives a stable data structure for processing.

 

Glad I could assist! If this answer helped resolve your issue, please mark it as Accept as Solution and give us Kudos to guide others facing the same concern.

Thank you.

View solution in original post

8 REPLIES 8
v-sgandrathi
Community Support
Community Support

HI @PhilSmith23,

 

To address the “The given key was not present in the dictionary” error in Power BI, begin by duplicating the query in Power Query Editor. Right-click the query causing issues, select "Duplicate," rename it, and remove any relationships with other tables. Use “Close & Apply.” If this version loads successfully, the issue is likely due to model dependencies. Then, remove all dependencies from the original query, including measures, calculated columns, or relationships, and try “Close & Apply” again.

Also, clearing Power BI’s cache can help, as it may contain outdated metadata. Navigate to File > Options and Settings > Options > Data Load > Clear Cache. If the error persists, consider creating a SQL view in MySQL (e.g., vw_MyWorkingQuery) with a consistent set of columns and import that view into Power BI instead of using the raw query. This ensures Power BI receives a stable data structure for processing.

 

Glad I could assist! If this answer helped resolve your issue, please mark it as Accept as Solution and give us Kudos to guide others facing the same concern.

Thank you.

Hi @PhilSmith23,

 

May I ask if you have gotten this issue resolved?

If it is solved, please mark the helpful reply or share your solution and accept it as solution, it will be helpful for other members of the community who have similar problems as yours to solve it faster.

 

Thank you.

Hi @PhilSmith23,

 

We haven’t heard from you on the last response and was just checking back to see if your query was answered.
Otherwise, will respond back with the more details and we will try to help .

If our response has addressed your query, please accept it as a solution and give a ‘Kudos’ so other members can easily find it. Please let us know if there’s anything else we can do to help.

 

Thank you.

Hi @PhilSmith23,

 

As we did not get a response, may I know if the above reply could clarify your issue, or could you please help confirm if we may help you with anything else?

 

And if the provided information meets your requirements, you can Accept the solution and also give Kudos on that reply. It helps other users who are searching for this same information and find the information.

 

Your understanding and patience will be appreciated.

Deku
Community Champion
Community Champion

Have a look at the transaction log in mysql to see what happens when you click apply. Might get a more useful error message.

 

Also if the query if folding you also grab the native folded query and try running against mysql


Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Thanx for the reply.  The query itself works fine.  I hand it to MySQL, it runs clean, finds all the records it should.  The problme is not with the query, or the MySQL connection, it is just the combination of this particular query in power BI.

parry2k
Super User
Super User

@PhilSmith23 Does table name or schema of the table changed? Can you start a blank query and try to connect to the source and see if it works?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thank for the reply. 

I built this query from scratch for this BI deck.  It runs clean directly against MYSQl.  It also previews just fine in BI.  It is only in the full load (Close and Apply) that it has an issue.  I have several other queries to the exact same source in this model, and thay all run fine.  

 

Watching the MySQL server, the query starts, the query finishes, (no errors,) THEN BI bombs with that error.  I get the impression that this error occurs when BI is trying to digest the results, not when getting them.

 

Phil

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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