Forum Discussion
mike_honey
10 years agoMemorable Member
Auto-rename all Query columns e.g. to remove underscore
Today I was grappling with shaping a series of Queries based on a SQL Datawarehouse. They use what's probably the best column naming standard (IMO) e.g. Sales_Amount. However PBI Desktop doesnt see...
arify
10 years agoMicrosoft Employee
Hi mike_honey,
We're still working on updating our documentation. Next time you needed a library function that doesn't appear in the documentation, try typing
= #shared
to the Power Query's formula bar like I suggested to greggyb. But 99% of the time, the function is already mentioned in a nicer way in the documentation, so that should be the first try.
About how to use it, there's some explanation and an example when you type
= Table.TransformColumnNames
to the PQ formula bar. In your case, it should probably look like this:
= Table.TransformColumnNames(table, (columnName as text) as text => Text.Replace(columnName, "_", ""))
ks1
9 years agoFrequent Visitor
Hi What's the right syntax for replacing several text strings?
I tried:
= Table.TransformColumnNames(table, (columnName as text) as text => Text.Replace(columnName, {"_", ""}, {"other text", ""}))
...but that didn't work
- mike_honey8 years agoMemorable Member
ks1 You've probably figured this out monts ago, but you would need to nest Text.Replace, e.g.
Text.Replace(Text.Replace(columnName, {"_", ""}), {"other text", ""})