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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
banav
New Member

Expression.Error: A cyclic reference was encountered during evaluation.

Hi All,

 

I am getting a very simple error while creating a M code. I tried it on a very simple data set but still its happening in all pbix files...

i am posting the pic of the table and the error.. 

Simple queries like this are giving error, I resinstalled Power BI desktop.. still the same

Picture1.pngPicture2.pngPicture3.png

1 ACCEPTED SOLUTION
v-yanjiang-msft
Community Support
Community Support

Hi @banav ,

According to your description, you only want to keep the Name and Age columns.

In your query steps, the previous step of Custom1 is "Changed Type", so in the Table.SelectColumns function, you should choose the #"Changed Type" as the table, but not the original "Data_Table", like this:

= Table.SelectColumns(#"Changed Type",{"Name","Age"})

Or you can create a blank query, insert the formula:

= Table.SelectColumns(Data_Table,{"Name","Age"})

Get the correct result.

vkalyjmsft_0-1650434012564.png

About the Applied steps, you can refer to this document: Applied steps - Power Query | Microsoft Docs

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-yanjiang-msft
Community Support
Community Support

Hi @banav ,

According to your description, you only want to keep the Name and Age columns.

In your query steps, the previous step of Custom1 is "Changed Type", so in the Table.SelectColumns function, you should choose the #"Changed Type" as the table, but not the original "Data_Table", like this:

= Table.SelectColumns(#"Changed Type",{"Name","Age"})

Or you can create a blank query, insert the formula:

= Table.SelectColumns(Data_Table,{"Name","Age"})

Get the correct result.

vkalyjmsft_0-1650434012564.png

About the Applied steps, you can refer to this document: Applied steps - Power Query | Microsoft Docs

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please considerAccept it as the solution to help the other members find it more quickly.

Hello @v-yanjiang-msft ,
I have a similar issue with my power bi data not sure why I am also getting "A Cyclic reference was encountered during evaluation". My goal is to do incremental refresh on this dataset that is coming from stored procedure.

Here are my steps:

1. Source : running the stored procedure from sql server

2. Then I Enable the query folding.

3. Created RangeStart and RangeEnd parameters.

4. Filtered the date/time field with above parameters.

5. Once I close & apply, it will show the error shown below.

Can you or someone please help me why? What do I need to do it?

Thanks for your support.

pthapa

pthapa_1-1715885815153.png

Here is the code from advanced editor:

pthapa_2-1715886048686.png

 

 

I am facing similar issue while creating the function Where I am looking to Group using Internal ID of the table and SUM values of one of the coloumn while filtering some other coloumns.

Below is the Mcode: = Table.AddColumn(#"Added Conditional Column", "Custom.1", each Table.AggregateTableColumn(#"Demand Fcst Raw Outputs (2)",[Internal ID],
List.Sum[Forecast],[Week Number]=Date.WeekOfYear(DateTime.LocalNow()) and [Week Number]=(Date.WeekOfYear(DateTime.LocalNow())+5)
))

I am facing cyclic reference was encountered in the above expression. How can I resolve it?

Anonymous
Not applicable

Hi! Were you able to resolve this issue? I have a similar problem I am trying to solve.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors