Forum Discussion

mork's avatar
mork
Helper V
10 years ago

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

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    I haven't figured out a way to get line breaks to appear where I want them and have tried a kinds of things like ASCII characters, etc. If you figure it out, I'd be very interested.

    • mork's avatar
      mork
      Helper V

      My gut tells me the right special characters are #(cr)#(lf) but they don't work at the moment.

       

      Greg_Deckler Do you have a workaround maybe? A way to better show text without line breaks?

      • FawadRehman's avatar
        FawadRehman
        Helper I

        I have been trying to use all the solutions available on the net but still no luck. Any Help from power BI guys? 

         

        Full Contact = LOOKUPVALUE(' Contacts'[Manager Name],' Contacts'[Id],'Customer Contact'[ ContactId])
        & " " & LOOKUPVALUE(' Contacts'[Email],' Contacts'[Id],'Customer Contact'[ ContactId])
        & " " & LOOKUPVALUE(' Contacts'[Telephone],' Contacts'[Id],'Customer Contact'[ ContactId])

         

        here's my code. 

  • I have this issue as well. My text string appear with line-break in PowerQuery but as a single line in the final tabel :-(

  • Anonymous's avatar
    Anonymous
    Not applicable
    I had the same issue trying to display an address....ended up concatenating the address lines together then using the long text visual to display it..as that is the only one that wraps text..
    • nilkaush's avatar
      nilkaush
      New Member

      Hi,

       

      How do you word wrap in long text viewer. Is there a special character that i can add to text data to make sure data is displayed in new line.

      • Brian_M's avatar
        Brian_M
        Continued Contributor

        Yes, you can add a custom string where you want the line break (I used "(LF)" but you can use anything) and then specify this under the Newline starts with option under Format > Text for the Long Text Viewer visual (Beta v.2) 

         

        HHope that helps!