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

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

Reply
Anonymous
Not applicable

File Transformation of csv files in Folder

I have read multiple articles that say they provided a solution to the issue I am having but they are not working.  I have a Folder that has mulitple CSV Files that are all Formatted the same.  I direct Power BI to get these files using the "From Folder" Option.  After I choose "Combine & Edit", I then set up all the steps I would like Power BI to perform to each file under the "Transform Sample File from "Folder Name"".  The most important and first step which is "Remove Top Row" is only being applied to the Sample File and not every other CSV File in the Folder.  It still keeps the top row from every other CSV File in the Folder causing my report to error out when I refresh it.  Am I missing a step somewhere or is this not possible with CSV Files?  I am downloading these files directly from a FTP so I have no control over the File extension.

4 REPLIES 4
camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

You can filter the extension. If you look to the tops applied steps, you can see the metadata about your folder. Just filter the extension there.

The transformations applied to the Sample File are applied to the other tables.  Maybe the layout is different for those csv files ?

Can you check it ?



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

All of the CSV Files are formatted the same because they are Generated automatically from a program.  Here is an example of how every file will look.  There are many more columns but the first line only has data to Column O

 

HDR20200517INVOICE NUMBERACCOUNT NUMBER COMPANY ADDRESSPORTLANDOR97201USINVOICE AMOUNT9658
DTL5118831105.34178E+20 HANDFULUSSEA153417822020051204.12121E+15119585339.37487E+21
DTL5118831205.34178E+20 HANDFULUSSEA153417822020051204.12121E+15119541449.37487E+21
DTL5118831305.34178E+20 HANDFULUSSEA153417822020051204.12121E+15119584969.37487E+21

 

I always want to remove this first line off every CSV File because it is not needed.  This line is just a summary of the Invoice and does not relate to the rest of the file.

@Anonymous ,

 

Check this file: Download PBIX 

 

I just created 3 csv, and excluded the 1 row for each file.

 

Here the files: Download CSV Files 

 

Just change the Source step on the Example CSV:

 

= Folder.Files("D:\Google Drive\Exemplo PBI\Example CSV") to:

= Folder.Files(YOUR_PATH)

 

If you are doing the same, please, the m-code applied to both tables (sample and result).



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

It looks like the issue is related to the Original Type of CSV File that is being downloaded.  I was going to send you 2 Sample Files after I removed the personal information but after I resaved the File as CSV again, the transformation in BI worked as expected.  I was hoping to find a solution to the problem without having to modify the files first.

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Kudoed Authors