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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

Program execution reached an invalid state

Hi all,


I'm having this error when I try to refresh the data.




Does anyone have any ideas to solve this issue?


Any help would be much appreciated.


Thanks in advance!


Kindly Regards,


Advocate I
Advocate I

Remove the part of your query that sets the specific fields as date or datetime (you can leave all other Change Type parameters in though) and see if that fixes it. Power BI might already be reading the field in as a date from your source data (i.e. SQL Database), so that extra step is unnecessary now. This fixed the problem for me. I removed it and could see that the field was already being read as date type.

This worked for me thanks!

Resolver III
Resolver III

Hi @Milan14 

Have you found a way out of this problem ?

I'm still facing this issue and it causes me trouble at work.


Best regards,


Resolver III
Resolver III

Hi all,


Same problem in France, hope it will be fixed soon !

Indeed I also came to the same conclusion : the error appears when trying to change the type of a column to date/time. With a SQL datasource.


Have a good day


Not applicable



Dear Forum,


I received the same error message this morning when I issued a refresh command on the Power BI Desktop.  The refresh was working fine last Satruday 21 Apr 2022.  Is the Power BI Team able to find the reason and fix the probelm ?


Thank you.  

Frequent Visitor

I am also getting this error. It's affecting PBi Desktop and Service, for me. I've already contacted Microsoft support, but they have not responded yet.



As @bwind said, it appears to be a recent problem with "change type" in Power Query. Just deleted one step and everything is working now.


Regular Visitor

Hello, I am having the same problem and still couldn't find the solution..

New Member

I am also getting this issue:


Refreshing works in my online workspace, but refreshing on Desktop throws the invalid state error.

I have narrowed it down to a single step: changing the type of a column which represents a timestamp from "Any" to datetime.


This appears to occur for every instance where I try to convert "Any" to datetime. It does not appear to be related to the input data, as applying a filter to only show older data (which worked at the time) yields the same error. 


This appears to have become an issue sometime in the last couple weeks. This is an old pbix file which used to work, and I have not modified recently...



New Member

I am seeing this error as well, but for me it is when we are trying to refresh MySQL dataflows via the online web portal. Our gateway can connect to the MySQL server just fine, and editing the dataflow can actually bring up a proper preview, but after precisely 31 seconds, every dataflow refresh stops and throws up the above-mentioned error.


"Error: Program execution reached an invalid state. The execution should have never reached this code. Request ID: 64066e82-2220-c5e0-6ffe-0d84801e5ff5 Activity ID: b4b457d6-6c66-422e-981a-acda66d89156"





I have the exact same error. Could you solve it finally?


Frequent Visitor

Same issue on our side...never had trouble getting "Program execution reached an invalid state. The execution should have never reached this code." 

Refresh is from a MySQL database hosted on AWS.

Online refresh still working...just not working in PBI Desktop.  

Tested on different datasets (eg. ODBC to local database) and it worked fine.  Others that are having these issues...

A) Is it just on desktop or in the service?

B) What are your data sources?

I'm also currently experiencing the same in a dataset that did not have any refresh issues before. If anyone has a solution on how to solve this kindly share..




Any help will be greatly appreciated!

Super User
Super User

@Milan14 , I doubt seeing this error. Please try again after some time. If you have done some changes. try to revert that and try.


Also log and issue -

Impactful Individual
Impactful Individual

Did anyone solved the problem?
@Cary_Carr Did you find a solution?

I'm getting the same error message when trying to refresh a dataflow connected to MySQL database.
Seems to be working well with a simple query of a small MySQL table, but fails on more complicated data transformations...

Impactful Individual
Impactful Individual

After some testing I can confirm that the problem seems to be related to date columns. But it happens not only on a Change Type step. I have no Change Type steps in my queries that cause dataflow refresh to fail, but I have Merge and Expand Columns steps. And it fails with "Program execution reached an invalid state" error if in Expand Columns step there is a date column.

As a workaround I'm changing column type to Integer before merging a table that contains date column with the main table. And then after Expand Columns step I'm using Change Type to change Integer back to Date. It solves the problem discussed in this topic, but it ruins Query Folding and makes dataflow refresh slower and as a result one of my queries still fails to refresh but this time with "Fatal error encountered during data read". A smaller query now works well with no "Program execution reached an invalid state" error...

I'm not sure if it's a bug in Power BI / Power Query, data gateway or MySQL connector, but my dataflows worked well until we replaced the gateway machine and reinstalled data gateway and MySQL connector. Maybe software update just triggered the problem not directly related to this software. By the way, the most recent version (8.0.29) of MySQL NET connector has another bug and doesn't work with Power BI, we're using a previous version.

Helpful resources

July 2024 Power BI Update

Power BI Monthly Update - July 2024

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

July Newsletter

Fabric Community Update - July 2024

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

Top Solution Authors
Top Kudoed Authors