---
title: Table.AddFuzzyClusterColumn – จัดกลุ่มข้อมูลที่คล้ายกัน
url: https://www.thepexcel.com/functions/power-query/table-functions/table-addfuzzyclustercolumn/
type: function-explainer
program: Power Query
syntax: "= Table.AddFuzzyClusterColumn(table as table, columnName as text, newColumnName as text, optional options as nullable record) as table"
date: 2025-12-06
updated: 2025-12-25
scores:
  popularity: 5
  difficulty: 4
  usefulness: 6
---

# Table.AddFuzzyClusterColumn – จัดกลุ่มข้อมูลที่คล้ายกัน

> Table.AddFuzzyClusterColumn เพิ่มคอลัมน์ใหม่ที่มีค่าตัวแทนสำหรับแต่ละกลุ่ม โดยจับคู่ข้อมูลที่คล้ายกั

## คำอธิบาย

Table.AddFuzzyClusterColumn เพิ่มคอลัมน์ใหม่ที่มีค่าตัวแทนสำหรับแต่ละกลุ่ม โดยจับคู่ข้อมูลที่คล้ายกัน แม้จะมีข้อความที่ต่างกัน เช่น การสะกด ตัวอักษรพิมพ์ใหญ่-เล็ก หรือช่องว่าง

## Syntax

```excel
= Table.AddFuzzyClusterColumn(table as table, columnName as text, newColumnName as text, optional options as nullable record) as table
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| table | Yes | Table |  | ตารางที่ต้องการเพิ่มคอลัมน์เคลสเตอร์ |
| columnName | Yes | Text |  | ชื่อคอลัมน์ที่มีข้อมูลที่ต้องการจับคู่แบบ Fuzzy |
| newColumnName | Yes | Text |  | ชื่อคอลัมน์ใหม่ที่จะเก็บค่าตัวแทนของแต่ละกลุ่ม |
| options | No | Record | [IgnoreCase = true, IgnoreSpace = true, Threshold = 0.80] | ระเบียนตัวเลือกสำหรับปรับแต่งการทำงาน เช่น Threshold, IgnoreCase, IgnoreSpace, Culture |

## เคสการใช้งาน

### ทำ Data Standardization

ทำ Data Standardization

### แก้ปัญหาข้อมูลซ้ำซ้อน (De-duplication)

แก้ปัญหาข้อมูลซ้ำซ้อน (De-duplication)

### เตรียมข้อมูล Master Data

เตรียมข้อมูล Master Data

## ตัวอย่าง

### 1. ตัวอย่างพื้นฐาน - ทำความสะอาดสถานที่

```excel
= Table.AddFuzzyClusterColumn(
    Table.FromRecords(
        {
            [EmployeeID = 1, Location = "Seattle"],
            [EmployeeID = 2, Location = "seattl"],
            [EmployeeID = 3, Location = "Vancouver"],
            [EmployeeID = 4, Location = "Seatle"]
        },
        type table [EmployeeID = nullable number, Location = nullable text]
    ),
    "Location",
    "Location_Cleaned",
    [IgnoreCase = true, IgnoreSpace = true]
)
```

**ผลลัพธ์:** `ตารางใหม่มี 5 คอลัมน์: EmployeeID, Location, Location_Cleaned
Location_Cleaned จะมีค่า:
- 'Seattle' สำหรับ rows 1, 2, 4
- 'Vancouver' สำหรับ row 3`

ฟังก์ชันจับคู่ 'Seattle', 'seattl', 'Seatle' เป็นกลุ่มเดียว (คล้ายกัน >80%) และใช้ 'Seattle' เป็นค่าตัวแทน

### 2. ตัวอย่างพื้นฐาน - ทำความสะอาดชื่อบริษัท

```excel
= Table.AddFuzzyClusterColumn(
    Table.FromRecords(
        {
            [CompanyID = 1, CompanyName = "Microsoft Corporation"],
            [CompanyID = 2, CompanyName = "microsft corporation"],
            [CompanyID = 3, CompanyName = "Google Inc"],
            [CompanyID = 4, CompanyName = "google INC"]
        },
        type table [CompanyID = nullable number, CompanyName = nullable text]
    ),
    "CompanyName",
    "CompanyName_Standard"
)
```

**ผลลัพธ์:** `ตารางใหม่มี CompanyName_Standard:
- 'Microsoft Corporation' สำหรับ rows 1, 2
- 'Google Inc' สำหรับ rows 3, 4`

ไม่ต้องกำหนด options ให้ใช้ค่าเริ่มต้น IgnoreCase=true ทำให้จับคู่ได้แม้มีตัวเล็ก-ใหญ่ต่าง

### 3. ตัวอย่างขั้นสูง - ใช้ Threshold สูงสำหรับความแม่นยำ

```excel
= Table.AddFuzzyClusterColumn(
    Source,
    "Product",
    "Product_Category",
    [Threshold = 0.95, IgnoreCase = true, IgnoreSpace = false]
)
```

**ผลลัพธ์:** `จัดกลุ่มเฉพาะสินค้าที่คล้ายกันมากกว่า 95% เท่านั้น ไม่ละเว้นช่องว่าง`

Threshold สูง = การจับคู่เข้มงวด ใช้เมื่อต้องการความแม่นยำสูง IgnoreSpace=false หมายความว่า 'Apple Pie' ≠ 'ApplePie'

### 4. ตัวอย่างขั้นสูง - เก็บคะแนนความคล้ายคลึง

```excel
= Table.AddFuzzyClusterColumn(
    Source,
    "CustomerName",
    "CustomerName_Cleaned",
    [
        Threshold = 0.80,
        SimilarityColumnName = "MatchScore"
    ]
)
```

**ผลลัพธ์:** `ตารางมี 2 คอลัมน์ใหม่:
- CustomerName_Cleaned (ค่าตัวแทน)
- MatchScore (คะแนน 0-1 ว่าค่าดั้งเดิมคล้ายกับตัวแทนเพียงไร)`

SimilarityColumnName ช่วยให้คุณเห็นว่าการจับคู่มีความมั่นใจเพียงไร ค่า 1.0 = ตรงกันทุกตัว, 0.80-0.99 = ยอมรับได้

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

- อย่าตั้ง Threshold = 1.00 แล้วคิดว่ามันจะเป็น fuzzy matching ถ้าอยากแบบนั้นใช้ Table.Distinct ไปเลย

- เปิด SimilarityColumnName ถ้าคุณกังวลว่าการจัดกลุ่มมันผิด มันจะบอกระดับความเชื่อมั่นให้ดู

- ลำดับสำคัญ: ใช้ Text.Trim() และ Text.Proper() ก่อน แล้วค่อยใช้ Table.AddFuzzyClusterColumn หลังจาก เพราะช่องว่างข้างหน้า-ข้างหลังมักหลอก fuzzy matching

- ผสม Table.ReplaceValue() เพื่อแทนที่ค่าดั้งเดิมด้วยค่าที่ทำความสะอาดแล้ว ทำให้ข้อมูลสะอาดสุด

- ถ้าข้อมูลมีตัวอักษรพิเศษหรือสัญลักษณ์ เช่น é, ñ, ç ตั้ง Culture ให้ถูกต้องไม่งั้นมันจับคู่ผิด

- ข้อมูลทั่วไป: Fuzzy matching ใช้ Levenshtein distance ตามหลัง ยิ่งห่าง = นับข้อผิดพลาดมากขึ้น ยิ่งใกล้ = คล้ายกันมากขึ้น

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

**Q: Table.AddFuzzyClusterColumn ต่างจาก Table.Distinct หรือ Table.Group อย่างไร?**

ง่ายๆ ก็คือ Table.Distinct มันแค่ลบแถวที่ซ้ำกันทุกตัว (ต้องตรงเป๊ะ) ส่วน Table.Group มันเพียงแค่จัดกลุ่มข้อมูลอย่างโง่ๆ (1+1 กับ 1.0 มันไม่เท่ากัน) แต่ Table.AddFuzzyClusterColumn มันชาญฉลาด มันจับคู่ที่คล้ายกันแล้วให้ค่าตัวแทน 1 ค่า ถ้าข้อมูลของคุณมี typo หรือเขียนไม่สม่ำเสมอ ตัวนี้เป็นทางออก

**Q: Threshold ควรตั้งค่าเท่าไหร่?**

ขึ้นอยู่กับว่าคุณต้องการความแม่นยำแค่ไหน: 0.70-0.80 = หลวมๆ (ยอมรับความผิดได้) | 0.80-0.90 = ตัวกลาง (ส่วนใหญ่ใช้อันนี้) | 0.90-0.99 = เข้มงวด (กลัวจัดกลุ่มผิด) ส่วนตัวผมชอบเริ่มที่ 0.80 แล้วทดสอบดู

**Q: ใช้กับ Power Query เวอร์ชันไหนได้?**

ได้ใน Microsoft 365 Excel, Power BI Desktop, Power Query Online, และ SQL Server 2019 ขึ้นไป ถ้าใช้ Excel เก่าๆ อาจต้องอัปเดต

**Q: เมื่อไรควรใช้ TransformationTable?**

เมื่อคุณมีรายการแมปที่รู้ล่วงหน้า เช่น 'USA' มีไว้แล้ว = 'United States', 'NYC' = 'New York' มันจะเร็วกว่า fuzzy matching เหมาะสำหรับข้อมูลที่ซ้ำๆ

**Q: ฟังก์ชันนี้จัดการกับภาษาต่างๆ ได้หรือ?**

ได้ใช้ Culture parameter: 'ja-JP' สำหรับญี่ปุ่น, 'th-TH' สำหรับไทย, 'de-DE' สำหรับเยอรมัน เป็นต้น ค่าว่าง = Invariant English (ไม่มีข้อความพิเศษ)

**Q: แต่ถ้าจัดกลุ่มข้อมูล 1 ล้านแถวนี่ใช้เวลาเท่าไร?**

มันขึ้นอยู่กับ Threshold และความซับซ้อนของข้อมูล โดยทั่วไป fuzzy matching เร็วกว่าการ filter-group-replace แบบ manual ส่วนตัวผมเจอข้อมูล 500,000 แถว ใช้เวลาประมาณ 1-2 นาทีเท่านั้น

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

- [Table.FuzzyGroup – จัดการตาราง](https://www.thepexcel.com/?post_type=function-explainer&p=37980)
- [Table.FuzzyJoin – เชื่อมตารางโดยใช้การเปรียบเทียบแบบ Fuzzy (คล้ายกัน)](https://www.thepexcel.com/functions/power-query/table-functions/table-fuzzyjoin/)
- [Table.FuzzyNestedJoin – จัดการตาราง](https://www.thepexcel.com/?post_type=function-explainer&p=37982)

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

- [Microsoft Learn - Table.AddFuzzyClusterColumn](https://learn.microsoft.com/en-us/powerquery-m/table-addfuzzyclustercolumn) _(official)_
- [Power Query How - M Language Reference](https://powerquery.how) _(article)_
- [Microsoft Power Query Documentation](https://learn.microsoft.com/en-us/powerquery-m/) _(official)_

---

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