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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
jay_za
Frequent Visitor

Retaining line breaks in exported report data

Hi everyone

 

Apologies if this is the wrong forum. It seemedl ike the best bet.

 

I've built a fairly straightforward report using Salesforce reports as datasources. One of the fields is a fairly long-winded measure that provides quite a bit of summary data as text in a single field, including multiple line breaks. The reason for this is that contextual info needs to be manually added before it gets sent to stakeholders, so that data gets exported from the report table, pulled into Excel and then context added (our directors are pretty old school in that regard).

 

The problem I have is that line breaks aren't being retained after exporting the table data, regardless of whether I do it to a csv through Desktop or to a xlsx via powerbi.com. I've tried unichar 10 and 13, quotes around the cell content, everything I can think of and no matter what I do, everything is dumped into a single line. For example:

 

"Hi" & UNICHAR(10) & "my name is" & UNICHAR(10) & "what"

Displays perfectly in a Power BI table cell as:

Hi

my name is

what

 

But in csv/xlsx is produces:

Himy name iswhat

 

Can anyone offer any thoughts on how to get those line breaks into Excel?

6 REPLIES 6
Ahmedx
Super User
Super User

pls try this

Screenshot_7.png

or

Screenshot_8.png

jay_za
Frequent Visitor

Hi Ahmed

 

I appreciate the thoughts, but a) unicode 160 is a non-breaking space, not any form of line break, and b) I can get it to display perfectly in a Power BI table using UNICHAR(10) or (13). As detailed in my first post, I need to find a way for the line breaks to carry through into a csv or xlsx when I export the table data.

 

it this way when exporting line breaks will save

jay_za
Frequent Visitor

Just a follow up note: I can export from the visual in desktop and it retains the line breaks perfectly. Once I publish, though, I need to specify exporting summarised data to csv - none of the other formats retain them.

jay_za
Frequent Visitor

Thank you! I apologise for just assuming and not testing first.

 

Including UNICHAR(160) adds an odd character to the field in the csv, so I took it out. Just leaving the UNICHAR(10) keeps the line break now though. What is different in how you did it? Is it the {} surrounding the formula?

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.