---
title: List.RemoveLastN – ลบ N รายการสุดท้าย
url: https://www.thepexcel.com/functions/power-query/list-functions/list-removelastn/
type: function-explainer
program: Power Query
syntax: list.removelastn(value as any) as any
date: 2025-12-12
updated: 2025-12-17
scores:
  popularity: 4
  difficulty: 3
  usefulness: 4
---

# List.RemoveLastN – ลบ N รายการสุดท้าย

> ลบ N รายการสุดท้าย

## คำอธิบาย

List.RemoveLastN ลบจำนวน N รายการสุดท้ายจากรายการข้อมูล ใช้สำหรับการตัดข้อมูลท้าย การแยกข้อมูล และการจัดการรายการ

## Syntax

```excel
list.removelastn(value as any) as any
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| value | Yes | any |  | ค่าหรือรายการที่ต้องการประมวลผล |

## ตัวอย่าง

### 1. ตัวอย่างที่ 1: ใช้งานพื้นฐาน

```excel
list.removelastn({1, 2, 3})
```

**ผลลัพธ์:** `ผลลัพธ์`

สูตรนี้ใช้ฟังก์ชันกับรายการอย่างง่าย

### 2. ตัวอย่างที่ 2: ใช้กับข้อมูลจริง

```excel
list.removelastn(SourceData)
```

**ผลลัพธ์:** `ผลลัพธ์จากข้อมูล`

สูตรนี้ใช้ฟังก์ชันกับข้อมูลจากแหล่งข้อมูลภายนอก

### 3. ตัวอย่างที่ 3: ใช้ในสูตรที่ซับซ้อน

```excel
let Data = {...}, Result = list.removelastn(Data) in Result
```

**ผลลัพธ์:** `ผลลัพธ์สุดท้าย`

สูตรนี้ใช้ฟังก์ชันภายในโครงสร้าง let-in

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

⚠️ สูตรนี้ใช้สำหรับการประมวลผลข้อมูล กรุณาอ่านเอกสารอย่างละเอียด

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

**Q: ฟังก์ชันนี้ใช้ทำไม**

ใช้สำหรับ: การตัดข้อมูลท้าย การแยกข้อมูล และการจัดการรายการ

**Q: สามารถใช้กับอาร์กิวเมนต์อื่นได้หรือไม่**

ได้ ฟังก์ชันนี้ยืดหยุ่นและสามารถใช้กับประเภทข้อมูลต่างๆ

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

- [List.Select – เลือกสมาชิกจาก List ตามเงื่อนไข](https://www.thepexcel.com/functions/power-query/list-functions/list-select/)
- [List.Transform – แปลงค่าในลิสต์แต่ละตัว](https://www.thepexcel.com/functions/power-query/list-functions/list-transform/)

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

- [Microsoft Learn: list.removelastn](https://learn.microsoft.com/en-us/powerquery-m/list-removelastn) _(documentation)_

---

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