odd issue with field names in Power query formulae

masplin

Active Member
Joined
May 10, 2010
Messages
413
I have downloaded some date from a website as an xlsx file and for example the field name is

"EBITDA margin (%) Last avail. yr"

However if I then add a power query command the field name appears as for example

= Table.AddColumn(#"Changed Type3", "EBITDA %", each [#"EBITDA margin (%)#(lf)Last avail. yr"]/100)

with a #(lf) inserted.

In this field "Turnover th GBP Last avail. yr" it converts to "Turnover#(lf)th GBP Last avail. yr" with the #(lf) inserted in first space

Any idea why it is doing this as makes it hard to manage the code?

Thanks any advice
Mike
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I believe #(lf) is a line feed character used in Excel to make the text carry over to the next line.
My suggestion is that as soon as you bring the data into Power Query you use the Clean function (right click Transform).
You might be able to use replace values if Clean does not work.

Hope that helps.
 
Upvote 0
If the line feed character is in the headers you could try the following. In power query demote the headers to first row. Then transpose the data. The headers are now in the first column. Clean this column. Transpose the data. Promote the first row back to headers.
 
Upvote 0
So these are hidden characters in the excel that only show up when you write the m Code. New one on me so thanks for advice
 
Upvote 0

Forum statistics

Threads
1,224,823
Messages
6,181,178
Members
453,021
Latest member
Justyna P

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top