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(_, "_", " ") )
teylyn
Advocate III
5 years agowdx223_Daniel Great to see that it can be done in one step. I find the M syntax less than intuitive when it comes to writing nested formulas.