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

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

> ดึงค่าจากแถวก่อนหน้าบนแกน

## คำอธิบาย

PREVIOUS ดึงค่าจากแถวก่อนหน้า (Previous Row) บนแกน (Axis) ที่ระบุในการคำนวณภาพ (Visual Calculations) ส่งกลับค่าที่มีการเลื่อนตำแหน่ง (Offset) ระบุจำนวนแถวที่ต้องการเลื่อนหลัง โดยค่าเริ่มต้นเป็น 1 ใช้สำหรับเปรียบเทียบค่า ปัจจุบันกับค่าก่อนหน้า

## Syntax

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

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| Column | Yes | column | ไม่มี | คอลัมน์ที่จะดึงค่า |
| Steps | No | integer | 1 | จำนวนแถวที่เลื่อน (ค่าต่ำสุด 1) |
| Axis | No | axis | ไม่มี | แกนสำหรับนำทาง VISUAL SHAPE |

## ตัวอย่าง

### 1. ดึงแถวก่อนหน้า

```excel
PREVIOUS(Sales[Amount], 1)
```

**ผลลัพธ์:** `ค่าจากแถวก่อน`

ดึงยอดขาย จากแถวก่อนหน้า สำหรับเปรียบเทียบ

### 2. เลื่อนหลายแถว

```excel
PREVIOUS(Sales[Amount], 3)
```

**ผลลัพธ์:** `ค่าจาก 3 แถวก่อน`

ดึงค่าจาก 3 แถวก่อน สำหรับเปรียบเทียบระยะไกล

### 3. คำนวณการเปลี่ยนแปลง

```excel
Sales[Amount] - PREVIOUS(Sales[Amount], 1)
```

**ผลลัพธ์:** `ความแตกต่าง`

คำนวณความเปลี่ยนแปลง ระหว่างแถวปัจจุบัน กับแถวก่อนหน้า

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

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

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

**Q: PREVIOUS ต่างจาก NEXT อย่างไร**

PREVIOUS = ดึงแถวก่อน | NEXT = ดึงแถวหลัง ใช้ในทางตรงข้าม

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

เปรียบเทียบค่าปัจจุบัน กับค่าก่อนหน้า คำนวณ YoY, Period-over-Period

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

ใช่ PREVIOUS เป็น Visual Calculations function ต้องใช้ใน Power BI

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

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

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

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

---

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