Forum Discussion
Prevent Power BI Automatically Renaming Columns to Include Spaces
- 10 years ago
On closer inspection it appears the spaces are automatically inserted at some point during the OLAP/MDX level rather than by PowerBI itself, however that doesn't really help resolve the problem.
Regardless of how the spaces are being inserted, I still need to get rid of them in R.
EDIT:
on testing it appears that the following solves the problem:
names(dataset) <- gsub(" ","_",names(dataset))
I am not seeing the underscores replaced by spaces. I imported from a CSV file and the columns came in with the underscores. Can you provide more details around source or exactly when/where you are seeing the underscores replaced?
On closer inspection it appears the spaces are automatically inserted at some point during the OLAP/MDX level rather than by PowerBI itself, however that doesn't really help resolve the problem.
Regardless of how the spaces are being inserted, I still need to get rid of them in R.
EDIT:
on testing it appears that the following solves the problem:
names(dataset) <- gsub(" ","_",names(dataset))