Forum Discussion
teylyn
Advocate III
5 years agoM Code to replace underscores in column names
Hi all, my SQL Server DBA tells me that SQL doesn't like spaces in column names, and all tables and views in that project have unsightly underscores. In Power BI, I want to replace them with blan...
- 5 years ago
Table.RenameColumns(Navigation,List.Transform(Table.ColumnNames(Navigation),each {_,Text.Replace(_,"_"," ")}))
- 5 years ago
Hi teylyn and wdx223_Daniel ,
I've been there as well before I've discovered that the M-language has some nice functions that are not exposed through the UI. Transforming column names with a custom function is one of them:Table.TransformColumnNames(Source, each Text.Replace(_, "_", " ") )
ImkeF
Community Champion
4 years agoHi DAXTERONPOWERBI ,
this error usually occurs when one misses a comma or didn't apply the quotes correctly. So you might want to check your M-code.