---
title: VARX.S – ฟังก์ชัน DAX
url: https://www.thepexcel.com/functions/dax/statistical/varx-s-dax/
type: function-explainer
program: DAX
syntax: "VARX.S(<Table>, <Expression>)"
date: 2025-12-15
updated: 2025-12-17
scores:
  popularity: 4
  difficulty: 5
  usefulness: 4
---

# VARX.S – ฟังก์ชัน DAX

> คำนวณความแปรปรวน (Variance) ของตัวอย่าง

## คำอธิบาย

VARX.S คำนวณความแปรปรวน (Variance) โดยสมมติว่าข้อมูลเป็นตัวอย่าง (Sample) ไม่ใช่ประชากร วัดการกระจายตัวของค่าที่คำนวณแล้วจากการประเมินนิพจน์ ใช้เมื่อข้อมูลที่วิเคราะห์เป็นตัวอย่างเพียงบางส่วน VARX.S มีค่าสูงกว่า VARX.P เพราะใช้ Sampling Correction

## Syntax

```excel
VARX.S(&lt;Table&gt;, &lt;Expression&gt;)
```

## Arguments

| Name | Required | Type | Default | Description |
| --- | --- | --- | --- | --- |
| Table | Yes | table | ไม่มี | ตารางข้อมูล |
| Expression | Yes | expression | ไม่มี | นิพจน์ที่ประเมินแต่ละแถว |

## ตัวอย่าง

### 1. คำนวณ Variance ของตัวอย่าง

```excel
VARX.S(Sales, Sales[Quantity] * Sales[Price])
```

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

คำนวณความแปรปรวนสำหรับตัวอย่างข้อมูล ใช้สำหรับประเมิน Risk ของตัวอย่าง

### 2. เปรียบเทียบ .S และ .P

```excel
VARX.S(...) vs VARX.P(...)
```

**ผลลัพธ์:** `.S = 3000, .P = 2500`

.S สูงกว่า .P เพราะใช้ Sampling Correction (n/(n-1))

### 3. วัดความแปรปรวนของส่วนตัวอย่าง

```excel
VARX.S(SAMPLE(100, Products, Products[Sales], DESC), Products[Price])
```

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

คำนวณ Variance ของราคา สินค้า 100 ชิ้น ที่เลือกแบบสม่ำเสมอ

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

💡 .S = Sample (ตัวอย่าง), .P = Population (ประชากร) | 🔗 ใช้ Sampling Correction | ⚠️ ส่วนใหญ่ใช้ .S มากกว่า .P

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

**Q: ควรใช้ .S หรือ .P**

ใช้ .S ถ้าข้อมูลเป็นตัวอย่าง (Sample) ใช้ .P ถ้าข้อมูลเป็นประชากรทั้งหมด

**Q: .S vs .P ต่างกันเท่าไหร่**

ต่างกัน ~2-3% เมื่อข้อมูลมากพอ .S = .P × n/(n-1) เล็กน้อย

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

ประเมิน Variance ของตัวอย่าง ใช้สำหรับทำ Inference เกี่ยวกับประชากร

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

- [VARX.P – ฟังก์ชัน DAX](https://www.thepexcel.com/functions/dax/statistical/varx-p-dax/)
- [STDEVX.S – ส่วนเบี่ยงเบนมาตรฐานแบบตัวอย่าง (Iterator)](https://www.thepexcel.com/functions/dax/statistical/stdevx-s-dax/)
- [AVERAGEX – หาค่าเฉลี่ยจากนิพจน์ที่คำนวณในแต่ละแถว](https://www.thepexcel.com/functions/dax/aggregation/averagex-dax/)

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

- [DAX.Guide: VARX.S](https://dax.guide/varx-s/) _(documentation)_
- [Microsoft Learn](https://learn.microsoft.com/en-us/dax/function/varx-s) _(documentation)_

---

_Source: [https://www.thepexcel.com/functions/dax/statistical/varx-s-dax/](https://www.thepexcel.com/functions/dax/statistical/varx-s-dax/)_
