cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
freelensia
Helper III
Helper III

Insert a line break in the middle of Power Query text (not a text in Excel)

Hi,

 

I am building some "fake" queries to store instructions for my Power Query user. One might looke like this:

 

let 
MyText = "Instructions
Welcome to the ...
Step 1:  ...
Step 2: ...
..."
in MyText

 

 

 But Power Query does not let me have these line breaks. I have also tried.

 

let 
MyText = "Instructions" & #(lf) &
Welcome to the ..."
in MyText

 

 

and:

 

let 
MyText = "Instructions" & unichar(10) &
Welcome to the ..."
in MyText

 

 

 Any ideas guys?

1 ACCEPTED SOLUTION
v-juanli-msft
Community Support
Community Support

Hi @freelensia 

You could paste your test into one cell of an excel file, then load that table from excel with Power BI.

Capture1.JPGCapture2.JPG

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @freelensia 

You could paste your test into one cell of an excel file, then load that table from excel with Power BI.

Capture1.JPGCapture2.JPG

 

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

freelensia
Helper III
Helper III

Never mind. I solved it with.

 

&  Character.FromNumber(10)&

 

 

Pretty annoying to have to insert this at the end of every line. Plus if I have the double quotation mark in the text I must replace it with & Character.FromNumber(34) &.

 

Any other ideas?  

The "& Character.FromNumber(10) &" works. The "#(lf)" does not seem to work in actual query strings (it simply gives an error looking for a token). The "Use Excel instead of Power Query" answer did not address the original issue at all. Thanks, freelensia, for following through and finding a solution that works.

Maybe too late to answer, but for anyone in future arriving here from Google:

These special strings are really handy:

  • Line feed: "#(lf)"
  • Carriage return: "#(cr)"
  • Tab: "#(tab)"

Also keep in mind that depending on the target OS that the text will be used in, dealing with line breaks can be slightly different. For example in Windows, it's usually CR + LF that you need to be safe in all apps (notepad anyone?), otherwise you may get away with a LF character.

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors