Forum Discussion
Receiving Expression.Error after removing a column
- Anonymous4 years ago
Hi rmahmood ,
The Table.RenameColumns function needs the replaced column name. "ID" in the formula cannot be removed.
Table.RenameColumns - PowerQuery M | Microsoft Docs
Do you want to delete the ID column in the table and keep the ID.1 column? Then you can rename the column name first, and then remove the ID column.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi rmahmood
If column does not exist, then PQ can not rename it. In your before code, ID column has been renamed as ID.1. The two values ID and ID.1 are part of a list. Now ID is removed so code does not specify which column to be renamed as ID.1
I belive solution is to remove rename step all together as you do not have the column itself.
Some examples are in this link.
https://docs.microsoft.com/en-us/powerquery-m/table-renamecolumns
Thanks