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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
clarksnike
New Member

Column cannot be found or may not be used in this expression after changing data source

Hello everyone 

 

Have checked few posts and sources, but still cannot find a solution.

 

The PowerBI pops up the message "column cannot be found or may not be used in this expression" when I apply change to the table that after change of data source.

 

I changed the data source from excel files to a SQL database, the data from the database has different column names and order. I have renamed the headers back to the old one (same as the original excel file). 

 

However, it pops up the the message "column cannot be found or may not be used in this expression" when I apply the change. There are mutiple tables and formulas linking to the column names, shouldn't all the existing relationships still be working given I have renamed all the columns already?

I tried to create a visulal just based on the new table (without linking to any other existing tables), the visual looks all good, and I can do calculations based on the new table with the columns within that new table. So it looks the type is defined correctly (I suppose the calculation would fail if I am not defining the columns as something else other than number).

 

Anyone know what's the issue here? All I did is just changing the data source from excel files to database, but the new columns are all renamed and defined correctly. Not sure why the existing relationships not working. Really appreciate your help!

 

Thank you!

1 REPLY 1
lbendlin
Super User
Super User

shouldn't all the existing relationships still be working given I have renamed all the columns already?

Are you sure you did?  Column names are case sensitive in Power Query (not in Power BI).  The slightest difference will make the relationships, measures, groups and sorts disappear.

 

You also need to make sure the column types are the same.

 

In short - swapping data sources is only safe if at the end of the Power Query code the resulting table is EXACTLY in the same format.

 

Go back to your backup that you took before this, and validate again.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors