Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Dataflow (connected to a MySQL data source) refresh fails with "Program execution reached an invalid state. The execution should have never reached this code." when there is a date type column in Expand Columns step.
This problem seems to be related to:
https://community.powerbi.com/t5/Desktop/Program-execution-reached-an-invalid-state/m-p/2510849
https://community.powerbi.com/t5/DAX-Commands-and-Tips/Program-execution-reached-an-invalid-state/m-...
After some testing I can confirm that it's about date type columns. But it happens not only on a Change Type step (what other users experienced). 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 tried to change 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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.