Forum Discussion
power query error "expression error"
Hi adlbrk
The step that raises the error doesn't help I'm afraid (I wrote Could you post, at least, the complete 'city 3326' query code?)
When you're in the Power Query Editor, click (in APPLIED STEPS) on the step Promoted Headers (highlighted in blue below):
and check the table Headers (column names) - Sure none of them is named 2024-01-02
promote headers formula is this:
= Table.PromoteHeaders(#"Renamed Columns", [PromoteAllScalars=true])
- LorenzoFeb 16, 2024Silver Contributor
Don't get me wrong but it's difficult to believe...
- In my 1st reply I asked you to post, at least, your complete query code
=> Still not received it - In my 2d reply I wrote "When you're in the Power Query Editor, click (in APPLIED STEPS) on the step Promoted Headers...and check the table Headers (column names) - Sure none of them is named 2024-01-02
=> You post a pic. showing the Promoted Headers step but do not tell me if any of the column (at that step) is named 2024-01-02
If you want to sort this issue out - with help from forum(s) - please provide the information you're asked
That said, a couple of things are obvious to me:
- Looking at the query step names, that query has been modified. No problem in principle as long as we understand how a query works and we know what we do
- Looking at your last picture it's interesting to note that the 1st few rows of the table (at the Promoted Headers step) show 2024-01-02 in the [Date] column
- There's a Renamed Columns step prior to the Promoted Headers step. I wonder what column(s) are renamed at that step???
- adlbrkFeb 18, 2024Copper Contributor
sorry it's taking me a while here. some of headers are renamed at that step but that shouldn't be an issue. Also, they weren't an issue until a couple weeks ago, and nothing was changed. see pics below:
- adlbrkFeb 18, 2024Copper Contributor
apologies, I didn't know where the power query code was til now.
let
Source = Web.Page(Web.Contents("https://docs.google.com/spreadsheets/d/e/2PACX-1vRJ32aTLkpVH9REqz4sHP0xuvvMLRU4lGRZNFkRLhKzK36CkLsJoD18YykTzBN1wNlb8JPdTXtpKGrJ/pubhtml?gid=1694590664&single=true")),
Data0 = Source{0}[Data],
#"Removed Columns" = Table.RemoveColumns(Data0,{"Column1", "Column2"}),
#"Renamed Columns" = Table.RenameColumns(#"Removed Columns",{{"Column3", "Date"}}),
#"Promoted Headers" = Table.PromoteHeaders(#"Renamed Columns", [PromoteAllScalars=true]),
#"Changed Type2" = Table.TransformColumnTypes(#"Promoted Headers",{{"2024-01-02", type date}}),
#"Renamed Columns3" = Table.RenameColumns(#"Changed Type2",{{"2024-01-02", "Date"}, {"ACH Electronic Debit - AMERICAN EXPR ACH PMT A0178 1", "Description"}, {"Checking", "Type"}}),
#"Split Column by Delimiter1" = Table.SplitColumn(#"Renamed Columns3", "-890.16", Splitter.SplitTextByDelimiter("-", QuoteStyle.None), {"-890.16.1", "-890.16.2"}),
#"Renamed Columns1" = Table.RenameColumns(#"Split Column by Delimiter1",{{"-890.16.2", "Debit"}, {"-890.16.1", "Credit"}}),
#"Removed Bottom Rows" = Table.RemoveLastN(#"Renamed Columns1",1),
#"Sorted Rows" = Table.Sort(#"Removed Bottom Rows",{{"Date", Order.Ascending}}),
#"Inserted Week of Month" = Table.AddColumn(#"Sorted Rows", "week of year", each Date.WeekOfMonth([Date]), Int64.Type),
#"Inserted Month Name" = Table.AddColumn(#"Inserted Week of Month", "Month", each Date.MonthName([Date]), type text)
in
#"Inserted Month Name"
- In my 1st reply I asked you to post, at least, your complete query code