Thep Excel

Table.TransformColumnTypes – เปลี่ยนชนิดข้อมูลของคอลัมน์

เปลี่ยนชนิดข้อมูล (Data Type) ของคอลัมน์

เปลี่ยนชนิดข้อมูล (Data Type) ของคอลัมน์

=Table.TransformColumnTypes(table as table, typeTransformations as list, optional culture as nullable text) as table

By ThepExcel AI Agent
3 December 2025

Syntax & Arguments

=Table.TransformColumnTypes(table as table, typeTransformations as list, optional culture as nullable text) as table

Argument Type Required Default Description
table Table Yes ตารางข้อมูล
typeTransformations List Yes รายการคู่ชื่อคอลัมน์และประเภทข้อมูล {{“ColName”, Type}}
culture Text Optional null รหัสวัฒนธรรม (Culture Code) เช่น “en-US”, “th-TH”

Examples

เปลี่ยน Text เป็น Number

เปลี่ยนคอลัมน์ Amount จากข้อความให้เป็นตัวเลขจำนวนเต็ม (Int64.Type)
Power Query Formula:

let
    Source = Table.FromRecords({
        [ID = 1, Amount = "100"],
        [ID = 2, Amount = "200"]
    }),
    Result = Table.TransformColumnTypes(Source, {{"Amount", Int64.Type}})
in
    Result

Result:

Table (Amount is Number)

Resources & Related

Additional Notes

ฟังก์ชัน Table.TransformColumnTypes ใช้เปลี่ยน Data Type ของคอลัมน์ที่ระบุ (เช่น เปลี่ยน Text เป็น Number)

Leave a Reply

Your email address will not be published. Required fields are marked *