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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
CWPRenewables
Frequent Visitor

CSV Carriage Returns Splitting Data to New Rows in Power Query

I am trying to transfer an old Excel query into Power BI, but have encountered an issue with carriage returns in my CSV source data.

It seems that when a csv dataset has carriage returns within cells Power BI automatically assumes this is a new row of data.

I can't work out what is happening, because the original Excel report has connected to the data using the Excel.CurrentWorkbook() connector, so I can only see that the data is being handled differently in the Excel file than it is in Power BI.

 

I can't apply any formulas in Power BI to remove the carriage returns because it is doing the split to a new row in the Source step. I'd prefer not to have to manipulate the data in excel prior to adding to Power BI.  I'm not lazy, i just want to be efficient.

 

Is there a setting I can adjust to avoid this row split?

1 ACCEPTED SOLUTION
JasonC_XBI
Advocate II
Advocate II

The issue is to do with the QuoteStyle being used in the query.

For more info, see the Official Documentation:

"QuoteStyle: Specifies how quoted line breaks are handled. QuoteStyle.None (default): All line breaks are treated as the end of the current row, even when they occur inside a quoted value. QuoteStyle.Csv: Quoted line breaks are treated as part of the data, not as the end of the current row."

 

To resolve it, edit your query as follows :

Csv.Document(file, [Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.Csv])

 

That is, make sure to have ".Csv" following QuoteStyle, instead of ".None"

View solution in original post

2 REPLIES 2
ckalbfleisch
Regular Visitor

Extremely helpful. This solved my issue. But in order to better understand it I also found this article to explain the various Encoding Tpes: TextEncoding.Type - PowerQuery M | Microsoft Learn

JasonC_XBI
Advocate II
Advocate II

The issue is to do with the QuoteStyle being used in the query.

For more info, see the Official Documentation:

"QuoteStyle: Specifies how quoted line breaks are handled. QuoteStyle.None (default): All line breaks are treated as the end of the current row, even when they occur inside a quoted value. QuoteStyle.Csv: Quoted line breaks are treated as part of the data, not as the end of the current row."

 

To resolve it, edit your query as follows :

Csv.Document(file, [Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.Csv])

 

That is, make sure to have ".Csv" following QuoteStyle, instead of ".None"

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors