0% found this document useful (0 votes)
30 views

Having Multiple Files That Share The Same Structure and Wanting To Combine Everything in One and Single Data Source?

The document discusses using Power Query to combine multiple files with the same structure into a single table. It provides steps to create a folder containing the files, use Power Query to connect to the folder, combine the files into one query, and close and apply the query to load the combined data as a single table for further analysis.

Uploaded by

Mhdi Mhdi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
30 views

Having Multiple Files That Share The Same Structure and Wanting To Combine Everything in One and Single Data Source?

The document discusses using Power Query to combine multiple files with the same structure into a single table. It provides steps to create a folder containing the files, use Power Query to connect to the folder, combine the files into one query, and close and apply the query to load the combined data as a single table for further analysis.

Uploaded by

Mhdi Mhdi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Having multiple files that share Sales 2017

the same structure


and Sales 2018

Wanting to combine everything


in one and single data source? Sales 2019
Power Query is there for you!

Go from this To this


One single table with all data

Sales 2017 Column 1 Column 2 Column 3


Sales 2017 data And finally to…
. . . .


Sales 2018 Sales 2018 data
. . . .


Sales 2019 data
Sales 2019
Or THIS
Having all data in a single table
facilitates further analysis

THIS

And finally to…


Or THIS
Step 1

Create a folder and put all files* in


that folder
Sales 2017

Sales 2018
The folder could be a local one or
a SharePoint/OneDrive one Sales 2019

* All files need to have same file type and structure (same column names, column types)
Step 2
Open Power BI Desktop

-> Click on « Get data »


-> select the « More… » option

Select the « Folder* » connector within


the list

*You can as well choose the « SharePoint folder» connector, but for
this demo we only use the « Folder » one
Step 3
Browse and select the previously created folder
containing all the files
-> click on « ok »

You’ll then have an overview of the files contained in


the selected folder

Click on « Transform data »


(you could as well just « Combine and load » or « Combine and transform », but for
demo purpose, we’ll choose the « Transform » option)
Step 4
Power Query will then open up, and a new query will
be added to your file.
This query is just a connection to your folder

In case you need to filter out some files, you could do


that in this part.
For example, you would want to ensure that only .csv
files will be taken into consideration or those
respecting a naming convention.

If everything in order,
just click on the « Combine » icon next to the
« Content » column
Step 5
Power Query analyzes the example file (by default,
the first one) and determines the correct connector
to use to connect to that file
(if needed, you may bring some changes to this part)
-> click on « Ok »

We will then see that we have some additional


« helper » queries auto-generated by Power Query

The initial « All files » query now contains all data


coming from the different files!

Don’t forget to « Close & Apply » when done


If you want to ensure that the newly created query
contains data from all files,
just check the available options in the
« Source.name » filter. You’ll see that all files were
added
What if I have a new file and need to add it to my dataset?

Just put it in the folder!

As you connect to the folder, all files (if not filters applied)
will be considered. You’ll only have to update the data and if
the file respects the same structure, new data will be
automatically added to your dataset

You might also like