Skip to main content
cancel
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

Reply
Milan14
Frequent Visitor

Program execution reached an invalid state

Hi all,

 

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

 

Milan14_0-1650294537570.png

 

Does anyone have any ideas to solve this issue?

 

Any help would be much appreciated.

 

Thanks in advance!

 

Kindly Regards,

Milan

16 REPLIES 16
tylerabbott
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!

Cado_one
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,

Cado

Cado_one
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

Cado

Anonymous
Not applicable

tai_meng_fai_0-1651035269555.png

 

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.  

vhugozg
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.

vhugozg_0-1650977296763.png

 

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.

 

tgchzl
Regular Visitor

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

bwind
New Member

I am also getting this issue:

bwind_1-1650613075084.png

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.

bwind_0-1650612684301.png

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...

Cheers,

Bennett

Cary_Carr
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"

 

Cary_Carr_0-1650480156665.png

 

Hi,

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

Thanks!

kreiss
Frequent Visitor

Same issue on our side...never had trouble before...now 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?

Hello,
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..

Kaskazi_Network_0-1650385567461.png

 

 

Any help will be greatly appreciated!

amitchandak
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 - https://community.powerbi.com/t5/Issues/idb-p/Issues

avatorl
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...

avatorl
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

Announcements
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