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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
adm31
Regular Visitor

Problem importing CSV into Power Query – broken rows and missing data

Olá a todos!

Estou enfrentando um problema ao importar arquivos CSV para o Power Query (Obter Dados > Pasta).
Os arquivos são separados por vírgulas e parecem corretos no Excel, mas no Power Query algumas linhas são quebradas e acabam ausentes ou incompletas.

Exemplo:

  • No CSV original, a linha de 12/08/2025 aparece completa (todas as colunas).

  • No Power Query, essa mesma linha é cortada e apenas o dia da semana permanece.

O que eu tentei:

  • Na função Transformar Arquivo, defina Csv.Document com Delimiter=",", Encoding=65001, QuoteStyle=Csv.

  • Também testado Columns=N (N = contagem de colunas de cabeçalho).

  • Ajudou, mas as etapas herdadas criadas anteriormente (por exemplo, Dividir coluna por delimitador quando tudo estava na coluna1) ainda quebraram a tabela até que eu as removi.

Pergunta:
Qual é a prática recomendada para fazer com que o Power Query leia o CSV exatamente como o Excel (sem quebrar as linhas no meio)? Alguma configuração ou padrão robusto para lidar com campos que contêm aspas ou quebras de linha?

Obrigado!

1 ACCEPTED SOLUTION
v-karpurapud
Community Support
Community Support

Hi @adm31 

Thank you for reaching out to the Microsoft Fabric Community Forum.
 
The issue you are experiencing is due to inconsistencies in the CSV files, such as embedded line breaks or improper use of quotes within the data. While Excel can often handle these irregularities and display the rows correctly, Power Query uses a more stringent CSV parser. As a result, if a field contains a line break or is not correctly enclosed in quotes, Power Query may interpret it as the end of a row, leading to broken, incomplete, or misaligned rows during import. To address this, make sure that your CSV files are consistently formatted before importing. All fields containing commas, quotes, or line breaks should be properly enclosed in double quotes, and the file encoding (such as UTF-8 or Windows-1252) should match Power Query’s expectations. When using Get Data from Folder, review the automatically generated “Transform Sample File” query, as legacy steps like splitting into a single column and re-splitting can introduce further issues. Instead, use the Csv.Document function with the correct delimiter, encoding, and QuoteStyle=Csv to ensure proper handling of quoted fields in Power Query.

If possible, please share the CSV file with us, as this will enable us to assist you more effectively.


Regards,
Microsoft Fabric Community Support Team.

View solution in original post

9 REPLIES 9
v-karpurapud
Community Support
Community Support

Hi @adm31 

Just checking in as we haven't received a response to our previous message. Were you able to review the information above? Let us know if you have any additional questions.

Thank You.

v-karpurapud
Community Support
Community Support

Hi @adm31 

We have not received a response from you regarding the query and were following up to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions.

 

Thank You.

v-karpurapud
Community Support
Community Support

Hi@adm31 

I wanted to check if you've had a chance to review the information provided. If you have any further questions, please let us know. Has your issue been resolved? If not, please share more details so we can assist you further.


Thank you.

v-karpurapud
Community Support
Community Support

Hi @adm31 

Thank you for reaching out to the Microsoft Fabric Community Forum.
 
The issue you are experiencing is due to inconsistencies in the CSV files, such as embedded line breaks or improper use of quotes within the data. While Excel can often handle these irregularities and display the rows correctly, Power Query uses a more stringent CSV parser. As a result, if a field contains a line break or is not correctly enclosed in quotes, Power Query may interpret it as the end of a row, leading to broken, incomplete, or misaligned rows during import. To address this, make sure that your CSV files are consistently formatted before importing. All fields containing commas, quotes, or line breaks should be properly enclosed in double quotes, and the file encoding (such as UTF-8 or Windows-1252) should match Power Query’s expectations. When using Get Data from Folder, review the automatically generated “Transform Sample File” query, as legacy steps like splitting into a single column and re-splitting can introduce further issues. Instead, use the Csv.Document function with the correct delimiter, encoding, and QuoteStyle=Csv to ensure proper handling of quoted fields in Power Query.

If possible, please share the CSV file with us, as this will enable us to assist you more effectively.


Regards,
Microsoft Fabric Community Support Team.

FBergamaschi
Solution Sage
Solution Sage

Have you checked the options of the separators when splitting (all occurrencies or first occurrence etc)?

 

Tye best would be having the csv though, to try personally

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

FBergamaschi
Solution Sage
Solution Sage

Ciao @adm31,

can you post the csv here so I understand the issue? And try myself to import it?

 

The problem with flat file is that they might not respect database's table rules and so it gets complex to apply fixes

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

In the original file (Excel opened directly from the CSV), each row appears correctly, with all the content in a single cell, separated by commas.
Example: on 08/12, the entire row is complete, with each value in the right place.

However, when I import it into Power Query and use the option to split by comma, that same row does not come through correctly: it gets broken in the middle, and only part of the information appears.
For the row on 08/12, only the weekday field (“Tue”) remains, while the rest of the row either disappears or gets misaligned.

 

Captura de tela 2025-09-01 091207.pngCaptura de tela 2025-09-01 091230.png

Anonymous
Not applicable

If you setup the import of a CSV file, the UI of PQ makes guesses of what might be the correct way to import the text file. And PQ isn't very good at guessing.

 

It doesn't matter what Excel does if you open the file, the rules that Excel uses are different.

 

We need to see your (sample) file, so we can adjust the MCode manually and share it with you.

 

Andreas.

It is not possible to import the screenshot you provided into Power Query. The easiest way to provide a usable data sample would be to upload your sample csv file to some shareable site (eg OneDrive, Google Drive, DropBox, etc) and then post a link here. You will obtain the most focused assistance that way.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.