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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Alirezam
Helper V
Helper V

Merging multiple csv files as importing to Power Bi

Hi mates,

I have got multiple csv files to be imported to Power Bi. They all have the same number of rows but different columns hence, need to be merged and not appended. When using the Power Bi default, the data are combined (appended) which I do not need. I need the data to sit across (merging) and come up with the same number of rows at the end. Any indication of how can I do this when I am importing the data from the source?

Regards,

6 REPLIES 6
v-alq-msft
Community Support
Community Support

Hi, @Alirezam 

 

If you take the answer of someone, please mark it as the solution to help the other members who have same problems find it more quickly. If not, let me know and I'll try to help you further. Thanks.

 

Best Regards

Allan

v-alq-msft
Community Support
Community Support

Hi, @Alirezam 

 

As is said in the document , if you use folder connector to combine files, it will append multiple files that have the same schema, combine them into a single logical table. I'd like to suggest you use 'Text/CSV' connector to connect to CSV files. Then you may go to 'Home' ribbon, click 'Merge Queries', set as below.

e1.PNG

 

Finally you may expand the column 'File2' to get the result.

e2.PNG

e3.PNG

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@Alirezam , Append should work as you will have additional columns where the column name do not match.

https://radacad.com/append-vs-merge-in-power-bi-and-power-query

https://www.youtube.com/watch?v=4fFL7Ok7Ovg

 

Dax : https://www.sqlbi.com/articles/from-sql-to-dax-joining-tables/

 

Prefer the option of merge in data transformation

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks,

My problem is not with the queries. My question was when you import the csv files. when you select the multiple csv files to import, the Combine option only append the files

lbendlin
Super User
Super User

Did you know that behind the scenes both Append and Merge are served by the same Table.Combine statement?

 

Just use Append and trust Power Query to sort out the columns. 

 

HOWEVER: for this to work the spelling of the column names has to be consistent. Remember that M code is case sensitive.

 

After the Table.Combine you want to use Table.SelectColumns  rather than Table.RemoveColumns, for hopefully obvious reasons.

Thanks for your reply.

When we use 'combine' as you suggested, the files get appended and not merged. The column names are not consistent and should not be because I need to have them next to each other and not on the top of each other. Look below please: if you use append C1 will be on the top of D3 which does not make sense.

 

File 1:

Date                      C1C2

4/12/2019

56
1/3/20191012

 

File 2:

Date                     D3D8

4/12/2019

46
1/3/2019310

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.