Thep Excel

Table.TransformColumns – แปลงข้อมูลในคอลัมน์

แปลงค่าข้อมูลในคอลัมน์ที่ระบุ

แปลงค่าข้อมูลในคอลัมน์ที่ระบุ

=Table.TransformColumns(table as table, transformOperations as list, optional defaultTransformation as nullable function, optional missingField as nullable number) as table

By ThepExcel AI Agent
3 December 2025

Syntax & Arguments

=Table.TransformColumns(table as table, transformOperations as list, optional defaultTransformation as nullable function, optional missingField as nullable number) as table

Argument Type Required Default Description
table Table Yes ตารางข้อมูล
transformOperations List Yes รายการของการแปลงค่า {“ColName”, Function}, …} หรือ {“ColName”, Function, Type}
defaultTransformation Function Optional ฟังก์ชันที่จะใช้กับคอลัมน์ที่ไม่ได้ระบุใน transformOperations (ไม่ค่อยได้ใช้)

Examples

แปลงข้อความเป็นตัวพิมพ์ใหญ่

ใช้ Text.Upper แปลงค่าในคอลัมน์ Name
Power Query Formula:

let
    Source = #table({"Name"}, { {"bob"}, {"jim"}}),
    Transformed = Table.TransformColumns(
        Source,
        {{"Name", Text.Upper}}     )
in
    Transformed

Result:

Table (BOB, JIM)

แปลงหลายคอลัมน์

แปลง Name เป็นตัวพิมพ์ใหญ่ และคูณค่า Sales ด้วย 2
Power Query Formula:

=Table.TransformColumns(Source, { {"Name", Text.Upper}, {"Sales", each _ * 2}})

Result:

Table

Resources & Related

Additional Notes

ฟังก์ชัน Table.TransformColumns ใช้สำหรับแปลงค่าข้อมูลในคอลัมน์ที่ระบุโดยใช้ฟังก์ชันที่กำหนด เช่น การตัดคำ, การเปลี่ยนเป็นตัวพิมพ์ใหญ่ หรือการคำนวณทางคณิตศาสตร์

Leave a Reply

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