---
title: LAST – ฟังก์ชัน DAX
url: https://www.thepexcel.com/functions/dax/visual-calculations/last-dax/
type: function-explainer
program: DAX
syntax: "LAST(<Column>, [<Axis>], [<OrderBy>], [<Blanks>], [<Reset>])"
date: 2025-12-15
updated: 2025-12-17
scores:
  popularity: 5
  difficulty: 3
  usefulness: 5
---

# LAST – ฟังก์ชัน DAX

> ดึงค่าจากแถวสุดท้ายบนแกน

## คำอธิบาย

LAST ดึงค่าจากแถวสุดท้าย (Last Row) บนแกน (Axis) ที่ระบุในการคำนวณภาพ (Visual Calculations) ส่งกลับค่าที่อยู่ตำแหน่งสุดท้ายของแกน ใช้เพื่อดึงค่าปิด (Closing Value) หรือเปรียบเทียบค่าปัจจุบัน กับค่าสิ้นสุด

## Syntax

```excel
LAST(&lt;Column&gt;, [&lt;Axis&gt;], [&lt;OrderBy&gt;], [&lt;Blanks&gt;], [&lt;Reset&gt;])
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| Column | Yes | column | ไม่มี | คอลัมน์ที่จะดึงค่า |
| Axis | No | axis | ไม่มี | แกนสำหรับนำทาง VISUAL SHAPE |
| OrderBy | No | column | ไม่มี | คอลัมน์ที่ใช้เรียงลำดับ |

## ตัวอย่าง

### 1. ดึงค่าสุดท้าย

```excel
LAST(Stock[Price])
```

**ผลลัพธ์:** `ราคาปิด`

ดึงราคาหุ้น จากแถวสุดท้าย (ราคาปิด)

### 2. เปรียบเทียบเปิดปิด

```excel
LAST(Stock[Price]) - FIRST(Stock[Price])
```

**ผลลัพธ์:** `การเปลี่ยนแปลง`

คำนวณการเปลี่ยนแปลง จากราคาเปิด ถึงราคาปิด

### 3. ดึงค่าเทพ

```excel
LAST(Account[Balance], AccountAxis, Order(Date, DESC))
```

**ผลลัพธ์:** `ยอดบัญชีล่าสุด`

ดึงยอดบัญชี จากวันที่ล่าสุด เรียงตามวันที่ลดลง

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

⭐ สำหรับ Visual Calculations | 💡 ดึงแถวสุดท้าย | 🔗 ต้องใช้ใน Power BI Visual Calculations

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

**Q: LAST ต่างจาก FIRST อย่างไร**

LAST = ดึงแถวสุดท้าย | FIRST = ดึงแถวแรก ใช้สำหรับจุดสิ้นสุด ค่าเริ่มต้น

**Q: ใช้สำหรับอะไร**

ดึงค่าล่าสุด, ปิด, หรือสิ้นสุด สำหรับเปรียบเทียบหรือวิเคราะห์

**Q: ต้องใช้ Visual Calculations ไหม**

ใช่ LAST เป็น Visual Calculations function ใช้ใน Power BI เท่านั้น

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

- [FIRST – ฟังก์ชัน DAX](https://www.thepexcel.com/functions/dax/visual-calculations/first-dax/)
- [PREVIOUS – ฟังก์ชัน DAX](https://www.thepexcel.com/functions/dax/visual-calculations/previous-dax/)
- next-dax

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

- [DAX.Guide: LAST](https://dax.guide/last/) _(documentation)_
- [Microsoft Learn](https://learn.microsoft.com/en-us/dax/function/last) _(documentation)_

---

_Source: [https://www.thepexcel.com/functions/dax/visual-calculations/last-dax/](https://www.thepexcel.com/functions/dax/visual-calculations/last-dax/)_
