Power BI
Needs VotesEditing a formula in the formula bar should preserve newlines, not replace with #(lf)
John Doggett on 21 Nov 2018 09:13:14
Using the Power Query formula bar to edit something like this:
= (_TimelineWithParent as any) => let
Initial = _TimelineWithParent,
#"Add initial pidx" = Table.DuplicateColumn(Initial, "parentIndex", "pidx"),
Might result in:
let
Source = #!"(_TimelineWithParent as any) => let#(lf) Initial = _TimelineWithParent,#(lf) #""Add initial pidx""
That is a heavily escaped string that now only looks right in the formula bar.
Formula bar and Advanced Editor should always agree...
- Comments (4)
RE: Editing a formula in the formula bar should preserve newlines, not replace with #(lf)
I would prefer preserving newlines and tabs in custom-written sql, too. It's absolutely annoying if you've got to make corrections in a datasource.
RE: Editing a formula in the formula bar should preserve newlines, not replace with #(lf)
This happens for me if I paste in a multi-line formula but failed to copy the = at the start. The logic seems to be that it looks like I meant to paste a string, so it tries to correct my input to an escaped string.Most of the automatic corrections make mistakes occasionally, but they're usually simple to fix. This correction is particularly aggressive, so either it should ask permission, or offer a simple way to revert it and let the user correct syntax manually.
RE: Editing a formula in the formula bar should preserve newlines, not replace with #(lf)
This seems to happen with formulas that are syntactically incomplete (e.g. extra comma, etc). If the syntax is correct the newlines get restored.
RE: Editing a formula in the formula bar should preserve newlines, not replace with #(lf)
Also happens a lot if you try to shift-click the entire contents of a multi-argument function call (text between the parents)