Expression error with data query

%3CLINGO-SUB%20id%3D%22lingo-sub-1123941%22%20slang%3D%22en-US%22%3EExpression%20error%20with%20data%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1123941%22%20slang%3D%22en-US%22%3E%3CP%3EHi%2C%20I%20have%20a%20table%20of%20data%20that%20is%20connected%20to%20my%20excel%20sheet%20through%20a%20query.%20When%20I%20try%20to%20refresh%20the%20table%2C%20I%20get%20this%20message%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%5Bexpression%20error%5D.%20The%20column%20%22calendar%22%20of%20the%20table%20wasn't%20found.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWhat%20do%20I%20do%20to%20fix%20this%3F%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1123941%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EPower%20BI%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1124281%22%20slang%3D%22en-US%22%3ERe%3A%20Expression%20error%20with%20data%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1124281%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F529102%22%20target%3D%22_blank%22%3E%40moneerbarazi%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EDepends...%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWas%20the%20column%20removed%20on%20purpose%3F%20If%20not%2C%20add%20it%20to%20the%20source%20file%20again%20(in%20the%20same%20position%20it%20was%20before)%20and%20power%20query%20designer%20can%20load%20the%20data%20again%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIf%20the%20column%20was%20removed%20on%20purpose%20and%20you%20don't%20need%20it%20anymore%2C%20you%20must%20change%20all%20steps%20in%20the%20query%20designer%20which%20refer%20to%20this%20column.%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EIn%20my%20example%2C%20I%20have%20loaded%20data%20from%203%20columns%20and%20then%20deleted%20column%202.%20Now%20I%20had%20to%20remove%20all%20steps%20in%20Power%20Query%20which%20were%20related%20to%20this%20column%20so%20basically%20I%20had%20to%20delete%20the%20text%20in%20red%20in%20screenshot%20below.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EHope%20this%20helps%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%222020-01-23_08h11_20.png%22%20style%3D%22width%3A%20999px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F166722iD0DFFFD9800CB62E%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20role%3D%22button%22%20title%3D%222020-01-23_08h11_20.png%22%20alt%3D%222020-01-23_08h11_20.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1925541%22%20slang%3D%22en-US%22%3ERe%3A%20Expression%20error%20with%20data%20query%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1925541%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F422482%22%20target%3D%22_blank%22%3E%40PascalKTeam%3C%2FA%3E%26nbsp%3BI%20am%20having%20a%20similar%20problem.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EFor%20over%204%20years%2C%20we%20have%20been%20using%20a%20google%20sheet%20to%20get%20daily%20stock%20prices.%26nbsp%3B%20We%20then%20published%20that%20google%20sheet%20to%20a%20.csv%20file%20that%20we%20inserted%20as%20a%20new%20query%20in%20Excel.%26nbsp%3B%20It%20has%20been%20working%20swimmingly%20until%2011%2F17%2F20.%26nbsp%3B%20Now%20we%20simply%20get%20the%20error%20that%20says%26nbsp%3B%3CSTRONG%3E%5BExpression.Error%5D%20The%20column%20'Symbol'%20of%20the%20table%20wasn't%20found%3C%2FSTRONG%3E.%26nbsp%3B%20Nothing%20has%20changed%20in%20either%20the%20google%20sheet%20or%20the%20Excel%20file.%26nbsp%3B%20No%20column%20heading%20have%20changed.%26nbsp%3B%20In%20Excel%2C%20When%20I%20refresh%20the%20query%20-%20get%20the%20error%20-%20I%20went%20to%26nbsp%3B%3CSTRONG%3EQuery%3C%2FSTRONG%3E%2C%26nbsp%3B%3CSTRONG%3EEdit%3C%2FSTRONG%3E%2C%20then%20clicked%20on%26nbsp%3B%3CSTRONG%3EAdvanced%20Editor%3C%2FSTRONG%3E.%26nbsp%3B%20Here%20is%20what%20is%20says%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CPRE%3E%3CFONT%20size%3D%222%22%3Elet%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3ESource%20%3D%20Csv.Document(Web.Contents(%22https%3A%2F%2Fdocs.google.com%2Fspreadsheets%2Fd%2Fe%2F2PACX-1vRxo60CNgqdRzU2RrA-mwHVuXSIbBOg84uorEBwfr98QvDMVkHGTosxVTccn6zfRPAQ9wecQay8fgSY%2Fpub%3Fgid%3D1316400444%26amp%3Bsingle%3Dtrue%26amp%3Boutput%3Dcsv%22)%2C%5BDelimiter%3D%22%2C%22%2C%20Columns%3D14%2C%20Encoding%3D1252%2C%20QuoteStyle%3DQuoteStyle.None%5D)%2C%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3E%23%22Promoted%20Headers%22%20%3D%20Table.PromoteHeaders(Source%2C%20%5BPromoteAllScalars%3Dtrue%5D)%2C%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3E%23%22Changed%20Type%22%20%3D%20Table.TransformColumnTypes(%23%22Promoted%20Headers%22%2C%7B%7B%22Symbol%22%2C%20type%20text%7D%2C%20%7B%22Date%22%2C%20type%20date%7D%2C%20%7B%22Curr%20Price%22%2C%20type%20number%7D%2C%20%7B%2252%20Wk%20High%22%2C%20type%20number%7D%2C%20%7B%2252%20Wk%20Low%22%2C%20type%20number%7D%2C%20%7B%22Mkt%20Cap%22%2C%20type%20number%7D%2C%20%7B%22%23%20Shares%20Out%22%2C%20type%20number%7D%2C%20%7B%22Volume%22%2C%20Int64.Type%7D%2C%20%7B%22Change%22%2C%20type%20number%7D%2C%20%7B%22%25%20Change%22%2C%20type%20number%7D%2C%20%7B%22Earnings%2FShare%22%2C%20type%20number%7D%2C%20%7B%22P%2FE%20Ratio%22%2C%20type%20number%7D%2C%20%7B%22Currency%22%2C%20type%20text%7D%2C%20%7B%22Comments%22%2C%20type%20text%7D%7D)%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3Ein%3C%2FFONT%3E%3CBR%20%2F%3E%3CFONT%20size%3D%222%22%3E%23%22Changed%20Type%22%3C%2FFONT%3E%3C%2FPRE%3E%3CP%3EThis%20is%20what%20is%20in%20my%20Google%20sheet%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22KPU73_1-1606177591641.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F235700i1F3BB6BE70DC09B0%2Fimage-size%2Fmedium%3Fv%3D1.0%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22KPU73_1-1606177591641.png%22%20alt%3D%22KPU73_1-1606177591641.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EWe%20have%20tried%20deleting%20the%20query%20from%20excel%3B%20republishing%20the%20Google%20Sheet%20to%20a%20new%20.CSV%20file%20and%20re-inserting%20the%20query%20in%20Excel%20-%20still%20the%20same%20error.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI'd%20be%20grateful%20for%20some%20specific%20help%20in%20how%20to%20fix%20this.%26nbsp%3B%20I'm%20pretty%20new%20to%20Power%20BI%2C%20so%20take%20some%20pity%20on%20how%20I'm%20explaining%20my%20issues%20please%20%3A))%3C%2FP%3E%3C%2FLINGO-BODY%3E
Occasional Visitor

Hi, I have a table of data that is connected to my excel sheet through a query. When I try to refresh the table, I get this message:

 

[expression error]. The column "calendar" of the table wasn't found.

 

What do I do to fix this?

10 Replies

Hi @moneerbarazi 

 

Depends...

 

Was the column removed on purpose? If not, add it to the source file again (in the same position it was before) and power query designer can load the data again

 

If the column was removed on purpose and you don't need it anymore, you must change all steps in the query designer which refer to this column. 

 

In my example, I have loaded data from 3 columns and then deleted column 2. Now I had to remove all steps in Power Query which were related to this column so basically I had to delete the text in red in screenshot below.

 

Hope this helps

 

2020-01-23_08h11_20.png

@PascalKTeam I am having a similar problem.

 

For over 4 years, we have been using a google sheet to get daily stock prices.  We then published that google sheet to a .csv file that we inserted as a new query in Excel.  It has been working swimmingly until 11/17/20.  Now we simply get the error that says [Expression.Error] The column 'Symbol' of the table wasn't found.  Nothing has changed in either the google sheet or the Excel file.  No column heading have changed.  In Excel, When I refresh the query - get the error - I went to QueryEdit, then clicked on Advanced Editor.  Here is what is says:

 

let
Source = Csv.Document(Web.Contents("https://docs.google.com/spreadsheets/d/e/2PACX-1vRxo60CNgqdRzU2RrA-mwHVuXSIbBOg84uorEBwfr98QvDMVkHGTosxVTccn6zfRPAQ9wecQay8fgSY/pub?gid=1316400444&single=true&output=csv"),[Delimiter=",", Columns=14, Encoding=1252, QuoteStyle=QuoteStyle.None]),
#"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),
#"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Symbol", type text}, {"Date", type date}, {"Curr Price", type number}, {"52 Wk High", type number}, {"52 Wk Low", type number}, {"Mkt Cap", type number}, {"# Shares Out", type number}, {"Volume", Int64.Type}, {"Change", type number}, {"% Change", type number}, {"Earnings/Share", type number}, {"P/E Ratio", type number}, {"Currency", type text}, {"Comments", type text}})
in
#"Changed Type"

This is what is in my Google sheet:

 

KPU73_1-1606177591641.png

 

We have tried deleting the query from excel; republishing the Google Sheet to a new .CSV file and re-inserting the query in Excel - still the same error.

 

I'd be grateful for some specific help in how to fix this.  I'm pretty new to Power BI, so take some pity on how I'm explaining my issues please :))

@KPU73 

I'd suggest to check credentials in Data Source settings on this source.

Do you see your columns on Promote Headers step?

Thank you so much for replying. Unfortunately I don’t have as much knowledge on the subject as perhaps I should. I am learning. Do you know what steps I can take to check this? I suspect that this may indeed be the issue. This is part of a macro that runs every evening and when I checked the virtual machine that this was running on I noticed that it was asking me for my Google ID and password. It was trying to install Google Drive. I think something might’ve changed with Google? Anyway, how can I check these credentials? In Excel? Or do I do it somewhere on the Google sheet? I know how to get to the advanced properties of the query within excel, but where do I check the credentials?
I am encountering the exact same issue! Stock quotes that I have used for several years has now stopped working. I've done nothing myself to the spreadsheet over the past week. Not sure if it is Google Drive or Excel

@KPU73 

Please try again. It didn't work few hours ago, right now I repeated your Power Query again and it works

image.png

It looks like it was break in services.

@millerboyz Most probably Google, please check my previous post here.

While my Google file appears to update correctly each time it is accessed, the Excel file continues to produce the error message when I attempt to refresh with data from Google.

@millerboyz I definitely think it had something to do with the link to the google sheet.  Now it works for me too.  Of course, I already crated a NEW google sheet and new spreadsheet to get it to work, but now when I go back to the old ones they work.  How crazy is that.  What gets me though is why it didn't just "say" that the problem was with some sort of connection/permissions issue, but instead gave the error alluding to a column issue.  Anyway - thanks to all who helped with this one.  As much as I'm a bit peeved at google right now, I couldn't do my job with out them, so will just have to chalk it up to a learning exprerience!

@KPU73 

If there is the problem with permission or like, Google returns you not the document but some page which informs you can't access the file or like.

 

Excel has no idea about that, it takes the page returned by Google assuming that is your document, and tries to transform it into table. First error appears is the lack or Symbol column, that's how your script is built. It returns that error and stops.

 

You may handle such errors, but that will require more serious effort in Power Query script building with coding on M-script.