Forum Discussion
Cannot reference column renamed to Week#(2) in Power Query (invalid identifier)
- 7 months ago
Hi T1moris
Power Query has two different concepts:
Display name (what you see in the UI) => Week#(2)
M language identifier (what the engine must use internally)
M has strict identifier rules. A column name can be referenced directly only if it: Starts with a letter or underscore and Contains only letters, numbers, and underscores
Your column name: Week#(2) violates three rules: # is special in M ( and ) are not allowed in identifiers
In M: #"Some Text" means “treat this text literally as a name” So when Power Query internally generates: "Week#(#)(2)"
The column name contains literal text Week#(2), and the # itself must be escaped This is not a rename mistake—it’s Power Query protecting itself from syntax errors.
Why do [Week#(2)] and [Week#(#)(2)] both fail?
Because square brackets only work for valid identifiers. This works: [SalesAmount] and This fails: [Week#(2)]Because Week#(2) is not a valid identifier, even if that looks like the column name.
The CORRECT way to reference this column is: [#"Week#(2)"]
# and parentheses are the issue, and what you’re seeing is Power Query trying to “escape” characters that have meaning in M.
In M, #(...) is used in special literals (like #date(2025,1,1) or #duration(...)).
So when you put #( inside a column name (Week#(2)), the rename UI tries to escape it and you end up with the weird internal text Week#(#)(2).