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)"]
Hi T1moris,
Just following up to see if the Response provided by community members were helpful in addressing the issue. if the issue still persists Feel free to reach out if you need any further clarification or assistance.
Best regards,
Prasanna Kumar