powerquery automation

Power Query Merge Multiple Excel Files and Create City Ranking by US Dollars

minbe-data 2026. 4. 6. 11:41

 

When multiple Excel files share the same structure, manually opening and combining them one by one takes too much time.

This example shows how to use Power Query to automatically merge multiple Excel files and generate a ranking based on US dollars.

Even if new Excel files are added to the folder, the result can be updated automatically with a simple refresh.

## Process

Using Power Query, the following steps are performed:

1. Load Excel files from a folder
2. Select the required columns
3. Merge all file data
4. Remove duplicate cities
5. Sort by US dollars
6. Create ranking automatically

## Result

All Excel files are merged into a single table, and the result is automatically

Power Query를 활용해 여러 Excel 파일을 자동으로 병합하고, US dollars 기준으로 도시별 Ranking을 생성하는 방법을 정리했습니다.

동일한 형식의 Excel 파일이 여러 개 있을 경우, 파일을 하나씩 열어 복사 후 합치는 작업은 시간이 많이 소요됩니다. 이러한 작업은 Power Query를 활용하면 훨씬 간단하게 자동화할 수 있습니다.

폴더에 Excel 파일을 넣어두기만 하면, 새로고침만으로 모든 파일이 자동으로 병합되고 데이터가 최신 상태로 업데이트됩니다.

이번 예제에서는 다음과 같은 흐름으로 데이터를 처리합니다.

1. 폴더 내 Excel 파일 불러오기  
2. 필요한 컬럼 선택  
3. 모든 파일 데이터 병합  
4. 도시 기준 중복 제거  
5. US dollars 기준 정렬  
6. Ranking 자동 생성  

최종적으로 여러 파일에 분산되어 있던 데이터가 하나의 테이블로 통합되고, 비용 기준으로 자동 정렬 및 Ranking이 생성됩니다.

Power Query를 활용하면 반복적인 데이터 통합 작업을 크게 줄일 수 있으며, 실무에서도 매우 효율적으로 활용할 수 있습니다.

Power Query, M code, 데이터 자동화 관련 실전 예제를 계속 공유할 예정입니다.

 

videolink - https://youtu.be/Twb1x6gz2IA

 

Download the sample file below.


You can download the zip file in [자료실][Download] page


The file name is 02.파일병합_랭킹(file merge)


Use the English M code provided for your dataset.


✔ Download the ready-to-use Power Query template below  
✔ Just copy and paste the M code – works instantly

 

Eng_m code.txt
0.00MB



The original sample file is based on a Korean dataset.
You can apply the English M code to adapt it to your own data.

 

--------------------------------

Need a custom automation for your Excel workflow?

I can build a tailored solution based on your data.

✔ Used in real-world business automation  
✔ Saves hours of manual work

minbedata@gmail.com

You can pay via PayPal.

You can also contact me via Upwork for secure payment and project handling.

 

<a href="https://www.upwork.com/freelancers/~01eb52dbd212cffc17" target="_blank">
Hire me on Upwork
</a>

You don't worry about conversing with me.

My Major is an English literature, so I can speak English fluently and read, listening, writing proficiently

korean version web address (한국버전) is 

<a href="https://blog.naver.com/minbe-data" target="_blank">네이버 블로그 바로가기</a>