Forum Discussion
Anonymous
6 years agoNot applicable
Why can't I simply remove a column?
I have a CSV file with 30 columns. I no longer need one of the columns so I have removed it. I then go into PBI and remove the column as well so I don't get errors when I try to refresh. But now ...
- 6 years ago
Hi Anonymous ,
I can't think of a better way to do it.
Guess, you will have to remove traces of it in Advanced Editor only.
Best Regards
Simran Tuli
mahoneypat
Microsoft Employee
6 years agoReferences to column names is one of the most common errors. You can edit the M code as you have done, but here are two other suggestions.
1. If you used Remove Other Columns, you can just click on the gear icon to open that dialog and close it, and it will update the M code with existing columns.
2. For some table functions, you can use MissingField.Ignore in the optional 3rd clause to ignore missing columns.
https://xxlbi.com/blog/safely-removing-columns-power-query/
If this works for you, please mark it as the solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat