Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
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?
Solved! Go to Solution.
Hi @freelensia
You could paste your test into one cell of an excel file, then load that table from excel with Power BI.
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.
really late answer, but might be useful for others
assuming you want to replace the semicolumns by a return to the line this line of M code might help
= Table.ReplaceValue(#"Changed Type",each [Column1],each Text.Replace([Column1],";", "#(lf)"),Replacer.ReplaceText,{"Column1"})
Hi @freelensia
You could paste your test into one cell of an excel file, then load that table from excel with Power BI.
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.
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:
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.
Thanks, for me, this is The Solution.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
24 | |
12 | |
11 | |
11 | |
8 |
User | Count |
---|---|
43 | |
25 | |
15 | |
14 | |
12 |