Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
mork
Helper V
Helper V

New line Characters

Hello, 

I use an excel file to import some text notes into Power BI for our departments. The notes are around two paragraphs and the show fine on excel. When importing them to Power BI they appear as a single line. I'm trying to solve this issue the past two weeks but I haven't managed to do that. 

 

I know that at the moment Power BI doesn't have a visual or a way to seperate lines. But there is the custom visual "Long text viewer" which looks like its the only way to go. Still though I have to find a way to insert new lines.

 

To do that I tried using HTML tags <p> </p> and the usual \n\r but it didn't work.

 

Then I found out that inside the query editor when replacing values, on the pop up that appears, under advanced options there is the option to use special characters. I selected line feed and carriage return. This replaced a value I had selected in my text with #(cr)#(lf) which seem to be the new line characters Power BI recognizes. 

 

This unfortunately for some weird reason only works inside query editor. What I mean is that inside the query editor on my table there is a line feed in every place there is that I replaced the value with the new line characters.

 

Outside of the query editor it doesn't work. When I go to the data view, all my txt data is still in a single line. Plus the special characters are no where to be seen. The long text viewer visual also doesn't work but I guess that is expected since my table doesn't show the text with multiple lines.

 

Does anyone have any solution to that? It is really vital for my business to make that text appear correctly. 

It doesn't really make sense for Power BI to provide the feature of line feed and carriage return only to work inside the query editor. Plus having a way to present multiline text is a must for every reporting tool and its a big omission from the side of Power BI.

31 REPLIES 31
Sean
Community Champion
Community Champion

Has anyone had any luck implementing this in the Card Visual ???

 

New Line Measure.gif

 

krg
Frequent Visitor

@Sean

Thanks! I have been looking for this. This worked for me.

 

@Sean - did you have to do something special to make Unichar work? I keep getting stuck with an invalid syntax error - but I can't see what I'm doing wrong. 

MarcelBeug
Community Champion
Community Champion

@Sean "Any luck" yes: bad luck Smiley LOL

 

It only seems to work with the matrix and table visuals.

 

 

Specializing in Power Query Formula Language (M)

arify / Vicky_Song -

 

I am not sure this thread is closed or the issue has been resolved....

But, I can reproduce the issue - that New Line or formatted text values ( fields created with special charactures #(cr)#(lf) or #(tab))

show up as formatted values in Power BI - Power Query, but the formatting is lost after the query is applied.

I am a newbe, so I may be wrong, but I have the same desired outcome as to want to display in a Text Visual a formatted string

For example:

John P. Jones
1121 S Andrews St
Faraway, NM, 09876
(123) 456-7890

 

I can create the field in Query Editor, but the formatting #(cr)#(lf) are lost when moving to the data view or in visualizations.

 

Is there a fix for this, or am I missing something in my approach.

 

Thanks for any guidance!!!

Hi @Johnnyg, when I checked it, at first it looked like one line, but the new line character is actually still there. What visualization are you using? Can you try to expand the size of the row vertically?

Johnnyg
Frequent Visitor

I have used a couple with the same results: LongTextViewer,  Table (standard with PowerBI).

 

The field value in Query Editor displays:

Edward

Jones

 

The Data Views displays:

Edward Jones

 

The Visuals (both) displays:

Edward Jones        (independent of the column/field width.

Can you please send a frown with that, and make sure you include the information in your last message (and maybe a link to this thread)?

 

Thanks

Johnnyg
Frequent Visitor

Done...Thanks!

@Vicky_Song Unfrtunately arify's solution is for splitting columns and not for line feed.

I think I've reproduced the issue, which turned out to be not an issue. Have you tried clicking those cells? Sometimes Excel shows multiple lines as one line, but when you click to that cell on the formula bar it shows it as multiple lines.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.