Thep Excel

Table.Buffer – โหลดตารางเข้า Memory เพื่อความเร็ว

โหลดตารางเข้า Memory เพื่อความเร็ว

โหลดตารางเข้าสู่หน่วยความจำ (RAM) เพื่อเพิ่มประสิทธิภาพในการเรียกใช้ซ้ำ

=Table.Buffer(table as table) as table

By ThepExcel AI Agent
3 December 2025

Syntax & Arguments

=Table.Buffer(table as table) as table

Argument Type Required Default Description
table table Yes ตารางที่ต้องการ Buffer

Examples

ตัวอย่างที่ 1: Buffer ข้อมูลเพื่อใช้ซ้ำ

ใช้เมื่อต้องอ้างอิงตารางนี้หลายครั้งในขั้นตอนถัดไป เพื่อลดการดึงข้อมูลใหม่
Power Query Formula:

=Table.Buffer(Source)

Result:

ตารางเดิมแต่โหลดเข้า RAM

ตัวอย่างที่ 2: Buffer ก่อนทำ Filter หลายรอบ

Buffer ตาราง Source ก่อนใช้หลายครั้ง เพื่อไม่ต้องโหลดซ้ำทุกครั้ง
Power Query Formula:

let
    Source = Table.FromRecords({
        [ID = 1, Status = "Active"],
        [ID = 2, Status = "Inactive"],
        [ID = 3, Status = "Active"]
    }),
    Buffered = Table.Buffer(Source),
    Active = Table.SelectRows(Buffered, each [Status] = "Active"),
    Inactive = Table.SelectRows(Buffered, each [Status] = "Inactive")
in
    {Active, Inactive}

Result:

สองตารางแยก Active และ Inactive โดยดึงข้อมูล Source ครั้งเดียว

ตัวอย่างที่ 3: Buffer ก่อนทำ Join

Buffer ตารางขนาดใหญ่ที่ต้องใช้ Join หลายครั้ง เพื่อเพิ่มความเร็ว
Power Query Formula:

let
    LargeTable = Excel.CurrentWorkbook(){[Name="Sales"]}[Content],
    BufferedLarge = Table.Buffer(LargeTable),
    Join1 = Table.NestedJoin(Orders, "ProductID", BufferedLarge, "ID", "Product"),
    Join2 = Table.NestedJoin(Returns, "ProductID", BufferedLarge, "ID", "Product")
in
    {Join1, Join2}

Result:

ทั้ง Orders และ Returns Join กับ LargeTable โดยโหลด LargeTable ครั้งเดียว

Resources & Related

Additional Notes

ฟังก์ชัน Table.Buffer ใน Power Query ใช้สำหรับโหลดตารางเข้าสู่หน่วยความจำ (RAM) เพื่อเพิ่มประสิทธิภาพในการเรียกใช้ซ้ำ

Leave a Reply

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