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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
willatkinson
Helper II
Helper II

Can you only get data from a folder if you are using the same format?

Hi all,

 

Just looking at an issue where someone is trying to import data from a folder to PowerBI desktop from their local files.

 

After doing a bit of research, I get the impression that getting data from a folder is only usful for combining files in a folder that are of the same file time and format.

 

Is it possible to, say for example, get data from a folder that contains both csv files and excel files, all the files of which are unrelated to each other so do not have the same format?

 

 

Cheers,

 

Will

6 REPLIES 6
lkalawski
Super User
Super User

@willatkinson ,

I see. Then the question immediately arises: do you want to store data from these different formats in one table?
If so, you need to perform transformations on one/both tables to bring them to the same format and then make an append.

 

________________________

PBI_SuperUser_Rank@1x.pngMemorable Member | Former Super User
If I helped, please accept the solution and give kudos! 
Linkedin

 

 

Hi @lkalawski, thanks for your responce.

 

In short, no. I would need all the sources to be available as seperate tables to work with, effectively remaining as seperate files, just all being brought in through the same folder.

 

Cheers,

 

Will

willatkinson
Helper II
Helper II

Hi all, thanks for your comments.

 

The issue I have is that the files won't have the same data structure (columns) so under no circumstance should be combined into one table.

 

Cheers,

 

Will

rajendraongole1
Super User
Super User

Hi @willatkinson -, you can indeed import data from a folder, and it's commonly used to combine files of the same format and structure.

  • Filter the table to only include rows where the "Extension" column equals ".csv." or xlsx
  • Click on the "Binary" column for one of the CSV or xlsx files and select "Combine Files."
  • Power BI will detect the format of the CSV or xlsx files and allow you to combine and load them.

all the table if we follow the same column headers, we can combine it together as one single fine.

Have to configured the import for each file type, click "Close & Load" to load the data into Power BI.

 

Did I answer your question? Mark my post as a solution! This will help others on the forum!
Appreciate your Kudos!!

 





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

Proud to be a Super User!





bhanu_gautam
Super User
Super User

@willatkinson , Yes we can include both csv and excel but we need to filter it separately,

 

I found out some steps on net

 

Combine Files:

Power BI will show a preview of the files in the folder. Click on Combine & Load or Combine & Transform Data.
In the Combine Files dialog, Power BI will attempt to combine the files. Since your files are of different formats, you will need to handle them separately.
Separate File Types:

In the Power Query Editor, you will see a query that attempts to combine the files. You can modify this query to handle different file types.
Filter the Extension column to separate CSV files and Excel files.
Process CSV Files:

Filter the Extension column to only include .csv files.
Expand the Content column to load the CSV data.
Apply any necessary transformations to the CSV data.
Process Excel Files:

Duplicate the original query and filter the Extension column to only include .xlsx or .xls files.
Expand the Content column to load the Excel data.
Apply any necessary transformations to the Excel data.




Did I answer your question? Mark my post as a solution! And Kudos are appreciated

Proud to be a Super User!




LinkedIn






lkalawski
Super User
Super User

Hi @willatkinson ,

The question is whether, despite having different formats, they have the same data structure (same columns). If so, you can of course write code that brings it together.
This can be done in two ways:

1.

  • Create a data source that will download .csv files from the folder and then connect to each other.
  • Create a data source that will download Excel files from the folder and then connect to each other.
  • Append these two sources.

2. Create connections to two sources in the M code and then append them.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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