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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Error message when a column was removed from data source that were referenced

How can I fix an error I'm getting when I load the data? A column was removed from the data source so when it syncs it has an error as the column is referenced something done in the applied steps.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Thanks for the reply from lbendlin , please allow me to provide another insight:

Hi, @Anonymous 

Currently, if you are unfamiliar with how your M language is structured, I recommend searching for and removing items line by line. For example:

My original data is as follows, and there is a custom column referencing the ID2 column that we intend to delete:

vlinyulumsft_0-1731032852049.png

Now, we will remove the ID2 column from the original data:

vlinyulumsft_1-1731032852051.png

If we apply this directly now, it will certainly result in an error:

vlinyulumsft_2-1731032901823.png

We just need to open Power Query and enter the Advanced Editor:

vlinyulumsft_3-1731032901824.png

A common first step is to change the data type, so we can delete that section:

vlinyulumsft_4-1731032919278.png

If there are any referencing columns, delete the entire row:

vlinyulumsft_5-1731032919279.png

You should note that each row corresponds to an application step in Power Query, so you need to check each line to see if the ID2 column has been applied, ensuring that every line in the let section, except for the last one, ends with a comma.

 

Finally, rename your last line to match the output section in the "in" part:

vlinyulumsft_6-1731033086370.png

This should allow for normal output.

vlinyulumsft_7-1731033086371.png

If there are any measures or calculated columns in the desktop section that reference this column, the most straightforward approach is to delete them again.

vlinyulumsft_8-1731033104795.png

vlinyulumsft_9-1731033104796.png

I hope my example helps you!

 

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Thanks for the reply from lbendlin , please allow me to provide another insight:

Hi, @Anonymous 

Currently, if you are unfamiliar with how your M language is structured, I recommend searching for and removing items line by line. For example:

My original data is as follows, and there is a custom column referencing the ID2 column that we intend to delete:

vlinyulumsft_0-1731032852049.png

Now, we will remove the ID2 column from the original data:

vlinyulumsft_1-1731032852051.png

If we apply this directly now, it will certainly result in an error:

vlinyulumsft_2-1731032901823.png

We just need to open Power Query and enter the Advanced Editor:

vlinyulumsft_3-1731032901824.png

A common first step is to change the data type, so we can delete that section:

vlinyulumsft_4-1731032919278.png

If there are any referencing columns, delete the entire row:

vlinyulumsft_5-1731032919279.png

You should note that each row corresponds to an application step in Power Query, so you need to check each line to see if the ID2 column has been applied, ensuring that every line in the let section, except for the last one, ends with a comma.

 

Finally, rename your last line to match the output section in the "in" part:

vlinyulumsft_6-1731033086370.png

This should allow for normal output.

vlinyulumsft_7-1731033086371.png

If there are any measures or calculated columns in the desktop section that reference this column, the most straightforward approach is to delete them again.

vlinyulumsft_8-1731033104795.png

vlinyulumsft_9-1731033104796.png

I hope my example helps you!

 

Please find the attached pbix relevant to the case.

 

Best Regards,

Leroy Lu

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

lbendlin
Super User
Super User

 

How can I fix an error I'm getting when I load the data? 

 

 

 

1. Don't remove columns.

2.  Use Table.SelectColumns rather than Table.RemoveColumns.

3. Read about how to manage missing columns in Power Query code.

 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.