---
title: Table.Combine – รวมหลาย table เข้าด้วยกัน
url: https://www.thepexcel.com/functions/power-query/table-functions/table-combine/
type: function-explainer
program: Power Query
syntax: "Table.Combine(tables as list, optional columns as any) as table"
date: 2025-12-03
updated: 2025-12-20
scores:
  popularity: 8
  difficulty: 3
  usefulness: 8
---

# Table.Combine – รวมหลาย table เข้าด้วยกัน

> Table.Combine ใช้สำหรับรวม list ของ table เข้าเป็น table เดียว ยับยั้ง append ตัว 1 แถวหลาย ๆ ตารางพ

## คำอธิบาย

Table.Combine ใช้สำหรับรวม list ของ table เข้าเป็น table เดียว ยับยั้ง append ตัว 1 แถวหลาย ๆ ตารางพร้อมกัน

## Syntax

```excel
Table.Combine(tables as list, optional columns as any) as table
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| tables | Yes | list |  | List ของ tables ที่ต้องการรวมกัน เช่น {Table1, Table2, Table3} |
| columns | No | any | null | Optional - ระบุ column structure ของ result table หรือใช้ union ของทุก column จาก input tables |

## ตัวอย่าง

### 1. รวม 3 tables ที่มี structure เหมือนกัน

```excel
= let
    Table1 = Table.FromRecords({
        [CustomerID = 1, Name = "Bob", Phone = "123-4567"],
        [CustomerID = 2, Name = "Jim", Phone = "987-6543"]
    }),
    Table2 = Table.FromRecords({
        [CustomerID = 3, Name = "Paul", Phone = "543-7890"]
    }),
    Table3 = Table.FromRecords({
        [CustomerID = 4, Name = "Alice", Phone = "246-1357"]
    }),
    Combined = Table.Combine({Table1, Table2, Table3})
in
    Combined
```

**ผลลัพธ์:** `Table with 4 rows:
[CustomerID = 1, Name = "Bob", Phone = "123-4567"]
[CustomerID = 2, Name = "Jim", Phone = "987-6543"]
[CustomerID = 3, Name = "Paul", Phone = "543-7890"]
[CustomerID = 4, Name = "Alice", Phone = "246-1357"]`

รวม 3 tables เข้าเป็น table เดียว 4 แถว ทุก column เหมือนกันเลยใช้ได้เลย

### 2. รวม tables ที่มี structure ต่างกัน (column อื่น)

```excel
= let
    ContactsEmail = Table.FromRecords({
        [Name = "Bob", Email = "bob@company.com"],
        [Name = "Jim", Email = "jim@company.com"]
    }),
    ContactsPhone = Table.FromRecords({
        [Name = "Paul", Phone = "543-7890"],
        [Name = "Alice", Phone = "246-1357"]
    }),
    AllContacts = Table.FromRecords({
        [Name = "Charlie", Email = "charlie@company.com", Phone = "135-7924"]
    }),
    Combined = Table.Combine({ContactsEmail, ContactsPhone, AllContacts})
in
    Combined
```

**ผลลัพธ์:** `Table with 5 rows and 3 columns (Name, Email, Phone):
[Name = "Bob", Email = "bob@company.com", Phone = null]
[Name = "Jim", Email = "jim@company.com", Phone = null]
[Name = "Paul", Email = null, Phone = "543-7890"]
[Name = "Alice", Email = null, Phone = "246-1357"]
[Name = "Charlie", Email = "charlie@company.com", Phone = "135-7924"]`

รวม tables ที่มี columns ต่างกัน มันจะทำ union ของ columns ทั้งหมด แล้วเติม null ให้ column ที่ขาดหาย

### 3. ระบุ column structure อย่างชัดเจน

```excel
= let
    Sales2024 = Table.FromRecords({
        [Region = "North", Amount = 1000, Year = 2024],
        [Region = "South", Amount = 1500, Year = 2024]
    }),
    Sales2025 = Table.FromRecords({
        [Region = "East", Amount = 2000, Year = 2025],
        [Region = "West", Amount = 1800, Year = 2025]
    }),
    AllSales = Table.Combine(
        {Sales2024, Sales2025},
        {"Region", "Amount", "Year"}
    )
in
    AllSales
```

**ผลลัพธ์:** `Table with 4 rows:
[Region = "North", Amount = 1000, Year = 2024]
[Region = "South", Amount = 1500, Year = 2024]
[Region = "East", Amount = 2000, Year = 2025]
[Region = "West", Amount = 1800, Year = 2025]`

ระบุ column ที่ต้องการใน parameter ที่สอง ถ้า table source มี column อื่นมากมาย มันจะเลือกแค่ column ที่ระบุ

### 4. รวม tables จาก multiple sources (real-world)

```excel
= let
    NorthRegionData = Table.FromRecords({
        [Store = "A", Sales = 5000, Staff = 10],
        [Store = "B", Sales = 7000, Staff = 15]
    }),
    SouthRegionData = Table.FromRecords({
        [Store = "C", Sales = 4500, Staff = 8],
        [Store = "D", Sales = 6000, Staff = 12]
    }),
    EastRegionData = Table.FromRecords({
        [Store = "E", Sales = 5500, Staff = 11]
    }),
    AllStores = Table.Combine({NorthRegionData, SouthRegionData, EastRegionData}),
    WithRegion = Table.AddColumn(
        AllStores,
        "Region",
        each if [Store] = "A" or [Store] = "B" then "North" 
             else if [Store] = "C" or [Store] = "D" then "South" 
             else "East"
    )
in
    WithRegion
```

**ผลลัพธ์:** `Table with 5 rows and 4 columns (Store, Sales, Staff, Region):
[Store = "A", Sales = 5000, Staff = 10, Region = "North"]
[Store = "B", Sales = 7000, Staff = 15, Region = "North"]
[Store = "C", Sales = 4500, Staff = 8, Region = "South"]
[Store = "D", Sales = 6000, Staff = 12, Region = "South"]
[Store = "E", Sales = 5500, Staff = 11, Region = "East"]`

รวม data จากหลาย region (3 tables) แล้วเพิ่ม column Region ด้วย Table.AddColumn ตอนจบ ทำให้ได้ complete dataset

### 5. รวม tables แล้ว filter ผลลัพธ์

```excel
= let
    Q1Sales = Table.FromRecords({
        [Month = "Jan", Amount = 1200],
        [Month = "Feb", Amount = 1500],
        [Month = "Mar", Amount = 1800]
    }),
    Q2Sales = Table.FromRecords({
        [Month = "Apr", Amount = 2000],
        [Month = "May", Amount = 1900],
        [Month = "Jun", Amount = 2200]
    }),
    AllSales = Table.Combine({Q1Sales, Q2Sales}),
    LargeSales = Table.SelectRows(AllSales, each [Amount] >= 1800)
in
    LargeSales
```

**ผลลัพธ์:** `Table with 4 rows:
[Month = "Mar", Amount = 1800]
[Month = "Apr", Amount = 2000]
[Month = "May", Amount = 1900]
[Month = "Jun", Amount = 2200]`

รวม tables แล้วใช้ Table.SelectRows เพื่อ filter เฉพาะ sales >= 1800

## หมายเหตุเพิ่มเติม

- ใช้ Table.Combine กับ List.Generate() เพื่อรวม tables จาก loop ได้

- พอ Table.Combine เสร็จแล้ว ใช้ Table.TransformColumnTypes เพื่อ standardize data types

- ถ้ารวม tables เยอะ ๆ อาจจะเร็ว ขึ้นถ้า specify columns ชัดเจนแทน union

- Table.Combine จะเก็บ row order จากตัว source tables ตามลำดับที่ส่งมา

- ใช้ Table.Combine แล้ว Table.SelectRows เพื่อ filter combined result

## คำถามที่พบบ่อย

**Q: ส่วนต่างคืออะไร ระหว่าง Table.Combine กับ Table.Append?**

Table.Append รวม 2 tables เพียงอย่างเดียว ส่วน Table.Combine รวม list ของ tables ได้ กดหลาย ๆ ตัวพร้อมกัน ถ้ามี tables มาก ๆ Table.Combine จะเขียนสั้นกว่า

**Q: ถ้า tables มี column ต่างกันเลยจะเกิดอะไร?**

มันจะทำ union ของ columns ทั้งหมด และเติม null ลงไปให้ column ที่ขาด ตัวอย่าง Table A มี [Name, Email] แต่ Table B มี [Name, Phone] ผลลัพธ์จะมี [Name, Email, Phone] โดย Email ใน rows จาก B จะเป็น null

**Q: มี column ที่ไม่ต้องการในผลลัพธ์ทำไงดี?**

ส่ง list ของ column names ในพารามิเตอร์ที่สอง เช่น Table.Combine({T1, T2}, {"Name", "Amount"}) มันจะเลือกแค่ 2 columns นี้

**Q: ถ้า tables เป็น empty จะเกิดอะไร?**

ถ้า list ว่าง {} จะได้ error ถ้า table บางตัวว่าง มันก็จะรวมแต่ตัวที่มีข้อมูล ผลลัพธ์อาจเป็น empty table หรือมีแถวได้

**Q: ถ้าต้องรวม 100 tables พร้อมกันได้ไหม?**

ได้ แต่ต้องใช้ List ของ tables เช่น Table.Combine(List.Generate(...)) หรือ append query references ลงใน list ก่อน

## ฟังก์ชันที่เกี่ยวข้อง

- table-append
- [Table.SelectRows – กรองแถวตามเงื่อนไขใน Power Query](https://www.thepexcel.com/functions/power-query/table-functions/table-selectrows/)
- [Table.AddColumn – เพิ่มคอลัมน์ใหม่ด้วย Calculated Values](https://www.thepexcel.com/functions/power-query/table-functions/table-addcolumn/)
- [Table.TransformColumnTypes – เปลี่ยนชนิดข้อมูลของคอลัมน์](https://www.thepexcel.com/functions/power-query/table-functions/table-transformcolumntypes/)
- [Table.FromRecords – สร้างตารางจากรายการ Record](https://www.thepexcel.com/functions/power-query/table-functions/table-fromrecords/)

## แหล่งข้อมูลเพิ่มเติม

- [Microsoft Learn: Table.Combine](https://learn.microsoft.com/en-us/powerquery-m/table-combine) _(official)_
- [Microsoft Learn: Table.Append](https://learn.microsoft.com/en-us/powerquery-m/table-append) _(official)_
- [PowerQuery.how - Table Functions](https://powerquery.how/) _(article)_

---

_Source: [https://www.thepexcel.com/functions/power-query/table-functions/table-combine/](https://www.thepexcel.com/functions/power-query/table-functions/table-combine/)_
