Forum Discussion
Need help to correct a syntax error in my power query formula
- Anonymous1 year ago
Hi,
Thanks for the solution ZhangKun and jgeddes offered, and i want to offer some mroe information for user to refer to.
hello Anonymous , you can click the 'Accout Name' and 'Postcode' columns, then click merged columns in 'Add column' tab
Then select split them by using the space.
Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Adding a column should have the code...
Table.AddColumn(previousStepName, "Trader Uid", each [Account Name] & Text.Clean([Postcode]), type text)
In your code you appear to be attempting to transform an existing column. I would guess the error in your code is due to {Account Name}. It should be [Account Name].
Hope this helps.
Thanks jgeddes for providing a responce with a sample code. Strangely I still get error - see screenshot-1 (same syntax error as before) when I try to add new column, or to transform an existing column (screenshot-2): invalid identifier.
Revised code used:
Add: = Table.AddColumn(#"Renamed Columns", "Trader Uid", each [Account Name] & Text.Clean([Postcode]), type text)
Transform: = Table.TransformColumns(#"Renamed Columns", {{"Trader Uid", each [Account Name] & " " & Text.Clean([Postcode]), type text}})