The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hello,
Having downloaded the latest version of Power BI desktop (Version: 2.104.702.0 64-bit (April 2022)), we are now encountering an "A cyclic reference was encountered during evaluation" exception when refreshing the data from a MySQL database:
We've traced the issue to the use of a Parameter named `Schema` in the Power Query as follows:
let Source = MySQL.Database(Server, Database, [ReturnSingleDatabase=true]), <query name> = Source{[Schema=Schema,Item="<table name>"]}[Data] in <query name>
A refresh of the data preview in the Power Query Editor works without any issues, it is only when we attempt to reload the data in the Power BI report that the exception is generated.
The issue is with the following specific snippet in the query:
Schema=Schema
The solution / workaround is to rename the Parameter to something other than "Schema". For example, the reload works as it did before if we change the query to use a new Parameter called "SourceSchema":
let Source = MySQL.Database(Server, Database, [ReturnSingleDatabase=true]), <query name> = Source{[Schema=SourceSchema,Item="<table name>"]}[Data] in <query name>
Whilst the use of a Parameter name which collides with a Power Query attribute name isn't a good principal to adopt, the concern is that this code has been working for months and is only generating an exception with the new version of Power BI Desktop.
The concern is that other users may have adopted this convention in their own Power BI reports and will therefore encoutner the same issue where:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Barry_Smart ,
We have submitted to internal ICM 304873937 , the status of this thread will be changed to Accepted to prove that this is a bug confirmed by Microsoft.
We have gotten some feedback from the PG team:
“The cyclic reference is because the record field name is Schema, and the customer is trying to assign the value of Schema to be Schema. This means that in order to evaluate the "Schema" field, the engine first has to evaluate the "schema" field, producing infinite recursion. This is not a problem with the connector, but with the customer's mashup query. Query editor uses different queries to produce (and refresh) the preview data, so the cyclic reference does not become immediately problematic until refresh when the customer's query is ran.
There is a simple mitigation for this: clients may avoid using schemas that have a name called schema, or referencing them from a different schema name.”
The bug has been submitted but there is no clear time frame for fixing it yet. Engineers are trying their best to solve this issue, please be patient and I will give you feedback here once there is any progress.
Best Regards,
Community Support Team _ Caitlyn