| ฟังก์ชัน | ใช้ทำอะไร | มีตั้งแต่ | นิยม | ยาก | ประโยชน์ |
|---|---|---|---|---|---|
| Date.MonthName Date functions | Date.MonthName(date as any, optional culture as nullable text) as nullable text
Date.MonthName ใช้สำหรับแยกชื่อเดือนภาษาอังกฤษจากค่าวันที่ที่ระบุ โดยส่วนใหญ่ใช้เมื่อต้องการแสดงชื่อเดือนแทนเลขเดือน
|
7 | 2 | 7 | |
| List.Transform List functions | = List.Transform(list as list, transform as function) as list
List.Transform ใช้สำหรับสร้างลิสต์ใหม่โดยนำฟังก์ชันไปประมวลผลแต่ละตัวในลิสต์เดิม
|
7 | 5 | 8 | |
| Table.ColumnNames Table functions | = Table.ColumnNames(table as table) as list
Table.ColumnNames ดึงชื่อคอลัมน์ทั้งหมดจากตาราง และส่งกลับมาเป็นลิสต์ข้อความ ซึ่งจำเป็นสำหรับการตรวจสอบ schema แบบ dynamic
|
7 | 2 | 7 | |
| Date.AddDays Date functions | Date.AddDays(dateTime as any, numberOfDays as number) as any
Date.AddDays ใช้เพิ่มหรือลดจำนวนวันให้กับค่า Date, DateTime หรือ DateTimeZone โดยระบุจำนวนวันที่ต้องการ (ใส่ค่าบวกเพื่อเพิ่มวัน หรือค่าลบเพื่อลดวัน)
|
7 | 3 | 8 | |
| Date.AddMonths Date functions | Date.AddMonths(dateTime as any, numberOfMonths as number) as any
Date.AddMonths เพิ่มจำนวนเดือนที่ระบุให้กับค่าวันที่ โดยคืนค่า date datetime หรือ datetimezone ขึ้นอยู่กับประเภทข้อมูลอินพุต ฟังก์ชันนี้จำเป็นสำหรับการคำนวณวันครบกำหนด กำหนดตารางเวลาโครงการ และการวิเคราะห์ข้อมูลตามช่วงเวลา
|
7 | 3 | 8 | |
| Table.Transpose Table functions | Table.Transpose(table as table, optional columns as any) as table
Table.Transpose จะกลับด้านตาราง คล้ายกับการ Copy > Paste Special > Transpose ใน Excel โดยข้อมูลในแถวที่ 1 จะกลายเป็นคอลัมน์ที่ 1 แถวที่ 2 เป็นคอลัมน์ที่ 2 ไปเรื่อยๆ
|
7 | 3 | 7 | |
| Text.EndsWith Text functions | Text.EndsWith(text as nullable text, substring as text, optional comparer as nullable function) as nullable logical
Text.EndsWith ตรวจสอบว่าข้อความหลักลงท้ายด้วยข้อความย่อย (substring) ที่กำหนดหรือไม่ คืนค่า true หากตรงกัน และ false หากไม่ตรงกัน สามารถใช้ Comparer เพื่อควบคุม Case Sensitivity
|
7 | 3 | 7 | |
| SharePoint.Files Accessing data functions | SharePoint.Files(url as text, optional options as nullable record) as table
SharePoint.Files ดึงตารางข้อมูลของเอกสารและโฟลเดอร์จาก SharePoint รวมถึงโฟลเดอร์ย่อยทั้งหมด คืนค่าเป็นตารางที่มีข้อมูลและลิงก์เข้าถึงไฟล์
|
7 | 4 | 7 | |
| DateTime.From DateTime functions | DateTime.From(value as any, optional culture as nullable text) as nullable datetime
DateTime.From แปลงค่าต่างๆ (Text, Date, Time, Number) ให้เป็นข้อมูลชนิด DateTime ด้วยการระบุค่าและรหัสภาษาทำให้สะดวกในการจัดการข้อมูลวันเวลาจากแหล่งต่างๆ
|
7 | 3 | 7 | |
| Table.ExpandListColumn Table functions | Table.ExpandListColumn(table as table, column as text) as table
Table.ExpandListColumn ใช้สำหรับขยายคอลัมน์ที่เก็บข้อมูลแบบ List ให้เป็นแถวแยก โดยแต่ละรายการใน List จะกลายเป็นแถวใหม่ ส่วนข้อมูลในคอลัมน์อื่นจะถูกทำซ้ำตามจำนวน
|
7 | 4 | 7 | |
| Text.Length Text functions | Text.Length(text as nullable text) as nullable number
Text.Length ใช้นับจำนวนตัวอักษรทั้งหมดในสตริงข้อความ รวมถึงช่องว่างและอักขระพิเศษ ผลลัพธ์คืนค่าเป็นตัวเลข มีประโยชน์ในการตรวจสอบคุณภาพข้อมูล การกรองข้อมูลตามความยาว หรือการคำนวณ Logic ต่างๆ
|
7 | 2 | 7 | |
| SharePoint.Contents Accessing data functions | SharePoint.Contents(url as text, optional options as nullable record) as table
SharePoint.Contents ดึงรายการโฟลเดอร์และไฟล์ทั้งหมดจาก SharePoint site เป็น navigation table ที่สามารถ drill down ไปยัง Document Libraries และ Lists ต่างๆ ได้
|
7 | 4 | 7 | |
| DateTime.Date DateTime functions | DateTime.Date(dateTime as any) as nullable date
ดึงเฉพาะส่วนวันที่ (Date) ออกจากค่า DateTime หรือ DateTimeZone โดยทิ้งเวลาไป
|
7 | 2 | 7 | |
| List.First List functions | = List.First(list as list, optional defaultValue as any) as any
List.First ใช้เพื่อดึงค่าสมาชิกตัวแรกจาก List หากเอา List ว่างเปล่า ให้ใช้ค่า Default ปกป้อง
|
7 | 2 | 7 | |
| Number.From Number functions | Number.From(value as any, optional culture as nullable text) as nullable number
Number.From จะพยายามแปลงค่า Input ให้เป็น Number หากเป็น Text จะพยายาม Parse ตัวเลขออกมา หากเป็น Date/Time จะแปลงเป็น Serial Number (เช่นเดียวกับ Excel)
|
7 | 2 | 7 | |
| Date.DayOfWeek Date functions | Date.DayOfWeek(dateTime as any, optional firstDayOfWeek as nullable number) as nullable number
แปลงวันที่ให้เป็นตัวเลข 0-6 แทนวันในสัปดาห์ (0=อาทิตย์ โดยค่าเริ่มต้น)
|
7 | 3 | 7 | |
| Date.ToText Date functions | Date.ToText(date as nullable date, optional options as any, optional culture as nullable text) as nullable text
Date.ToText แปลงค่า Date ให้เป็น Text String โดยสามารถกำหนด Format และ Culture ได้ตามต้องการ เหมาะสำหรับแสดงผลวันที่ในรูปแบบที่สวยงาม
|
7 | 3 | 7 | |
| Table.CombineColumns Table functions | Table.CombineColumns(table as table, sourceColumns as list, combiner as function, newColumnName as text) as table
Table.CombineColumns รวมข้อมูลจากหลายคอลัมน์เข้าด้วยกันเป็นคอลัมน์เดียว โดยใช้ฟังก์ชัน Combiner ที่กำหนดเอง เช่น รวมชื่อ-นามสกุล หรือสร้างรหัสประจำตัว
|
7 | 3 | 7 | |
| Table.Join Table functions | Table.Join(table1 as table, key1 as any, table2 as table, key2 as any, optional joinKind as nullable number, optional joinAlgorithm as nullable number, optional keyEqualityComparers as nullable list) as table
Table.Join ใช้รวมตารางสองตารางโดยจับคู่ค่าในคอลัมน์กำหนด สนับสนุนทุกประเภท join (Inner, Left Outer, Right Outer, Full Outer, Anti, Semi) เหมือน SQL Join
|
7 | 5 | 8 | |
| Text.Start Text functions | Text.Start(text as nullable text, count as number) as nullable text
Text.Start ดึงอักขระจำนวนที่กำหนดจากตัวแรกของสตริงข้อความ ใช้สำหรับดึงชื่อย่อ รหัส หรือส่วนแรกของข้อมูล
|
7 | 2 | 7 | |
| Date.FromText Date functions | Date.FromText(text as nullable text, optional options as any) as nullable date
Date.FromText แปลงค่าข้อความให้เป็นค่าวันที่ รองรับการระบุรูปแบบวันที่และภาษาที่แตกต่างกัน ฟังก์ชันนี้จำเป็นสำหรับการอ่านข้อมูลวันที่จากแหล่งข้อมูลภายนอก การจัดการข้อมูลที่มีรูปแบบวันที่หลากหลาย และการทำให้ข้อมูลเป็นมาตรฐาน
|
7 | 3 | 7 | |
| Table.Pivot Table functions | = Table.Pivot(table, pivotValues, attributeColumn, valueColumn, [aggregationFunction])
Table.Pivot แปลงข้อมูล long format (แนวตั้ง) เป็น wide format (แนวนอน) โดยหมุนค่า attribute ให้เป็นคอลัมน์ใหม่
|
7 | 5 | 8 | |
| Table.AddIndexColumn Table functions | Table.AddIndexColumn(table, newColumnName, [initialValue], [increment], [columnType])
Table.AddIndexColumn ใช้สำหรับเพิ่มคอลัมน์ที่มีลำดับเลขให้กับตาราง ช่วยให้สามารถกำหนดหมายเลขแถวตามลำดับได้
|
7 | 3 | 7 | |
| File.Contents Accessing data functions | = File.Contents(path as text, optional options as nullable record) as binary
File.Contents ใช้อ่านข้อมูล binary ของไฟล์จากพาธที่ระบุ เพื่อนำเข้าข้อมูลจากระบบไฟล์ลงในโปรแกรม
|
7 | 2 | 7 | |
| Splitter.SplitTextByDelimiter Splitter functions | Splitter.SplitTextByDelimiter(delimiter as text, optional quoteStyle as nullable number, optional csvStyle as nullable number) as function
Splitter.SplitTextByDelimiter สร้างฟังก์ชันสำหรับแยกข้อความเป็นรายการโดยใช้ตัวคั่นที่ระบุ มีประโยชน์เมื่อต้องแยก CSV หรือข้อความที่คั่นด้วยตัวอักษรเฉพาะ
|
7 | 3 | 7 | |
| Text.StartsWith Text functions | Text.StartsWith(text as nullable text, substring as text, optional comparer as nullable function) as nullable logical
Text.StartsWith ตรวจสอบว่าข้อความหลักขึ้นต้นด้วยข้อความย่อยที่กำหนดหรือไม่ โดยคืนค่า true หรือ false สามารถระบุ Comparer เพื่อเลือกว่าจะให้ตรวจสอบแบบ Case Sensitive (ไว) หรือ Case Insensitive (ไม่ไว) ได้
|
7 | 3 | 7 | |
| Date.EndOfMonth Date functions | Date.EndOfMonth(dateTime as any) as any
คืนค่าวันสุดท้ายของเดือนที่กำหนด โดยรักษาประเภท (date, datetime, หรือ datetimezone) ไว้เหมือนเดิม
|
7 | 2 | 7 | |
| List.Distinct List functions | List.Distinct(list as list, optional equationCriteria as any) as list
List.Distinct จะคืน List ใหม่ที่ไม่มีค่าซ้ำกัน โดยเก็บสมาชิกตัวแรกที่พบไว้ และทิ้งตัวที่ซ้ำกันทิ้งไป สามารถกำหนด Comparer เพื่อใช้ Logic การเปรียบเทียบที่แตกต่างกันได้ เช่น ไม่สนใจตัวพิมพ์เล็ก/ใหญ่
|
7 | 2 | 7 | |
| List.Sort List functions | List.Sort(list as list, optional comparisonCriteria as any) as list
เรียงลำดับสมาชิกในรายการตามเงื่อนไขที่กำหนด ไม่ว่าจะเป็นจากน้อยไปมากหรือมากไปน้อย
|
7 | 2 | 7 | |
| List.Contains List functions | List.Contains(list as list, value as any, optional comparer as nullable function) as logical
List.Contains จะคืนค่า true หาก value ที่กำหนดเป็นสมาชิกของ List และคืนค่า false หากไม่พบ สามารถระบุ Comparer เพื่อกำหนดว่าจะให้ตรวจสอบแบบ Case Sensitive หรือ Case Insensitive ได้
|
7 | 3 | 7 | |
| Text.Proper Text functions | Text.Proper(text as nullable text, optional culture as nullable text) as nullable text
แปลงอักษรตัวแรกของทุกคำเป็นตัวพิมพ์ใหญ่ (Title Case) และส่วนที่เหลือเป็นตัวพิมพ์เล็ก
|
7 | 2 | 7 | |
| Date.StartOfMonth Date functions | Date.StartOfMonth(dateTime as any) as any
คืนค่าวันแรกของเดือน โดยรีเซ็ตวันที่เป็นวันที่ 1 และเวลาเป็น 00:00:00
|
7 | 2 | 7 | |
| Number.RoundDown Number functions | Number.RoundDown(number as nullable number, optional digits as nullable number) as nullable number
ปัดเศษลงเสมอ (Floor)
|
6 | 2 | 6 | |
| DateTime.Time DateTime functions | DateTime.Time(dateTime as any) as nullable time
ฟังก์ชันที่ดึงเฉพาะส่วนเวลา (Time) ออกจากค่า DateTime เมื่อคุณต้องการแยกเวลาจากค่าวันที่และเวลารวมกัน
|
6 | 2 | 6 | |
| MySQL.Database Accessing data functions | = MySQL.Database(server as text, database as text, optional options as nullable record) as table
MySQL.Database เป็นฟังก์ชันตัวเชื่อมต่อ (connector) ที่ใช้ส่งข้อมูลจากฐานข้อมูล MySQL ไปยัง Power Query ช่วยให้คุณสามารถโหลดตารางและมุมมองจากเซิร์ฟเวอร์ MySQL ได้
|
6 | 4 | 6 | |
| Table.FromRecords Table functions | Table.FromRecords(records as list, optional columns as any, optional missingField as nullable number) as table
แปลง List ของ Record เป็นตาราง โดยแต่ละ Record กลายเป็นหนึ่งแถว เหมาะสำหรับข้อมูลจาก API หรือ JSON
|
6 | 4 | 7 | |
| Text.From Text functions | Text.From(value as any, optional culture as nullable text) as nullable text
แปลงค่าใดๆ เป็นข้อความ (Text)
|
6 | 2 | 6 | |
| SharePoint.Tables Accessing data functions | = SharePoint.Tables(url as text, optional options as nullable record) as table
SharePoint.Tables เป็นฟังก์ชันสำหรับดึงข้อมูลทั้งหมดจาก SharePoint List มา Power Query โดยคืนค่าตารางที่มีแถวสำหรับแต่ละรายการใน List พร้อมกับจัดการการเชื่อมต่อและการรับรองตัวตนอัตโนมัติ
|
6 | 4 | 6 | |
| Duration.TotalDays Duration functions | Duration.TotalDays(duration as nullable duration) as nullable number
Duration.TotalDays ใช้แปลงค่า duration เป็นจำนวนวันทั้งหมด (รวมทศนิยม) เหมาะสำหรับคำนวณช่วงเวลาที่ต้องความแม่นยำ
|
6 | 2 | 6 | |
| Xml.Document Accessing data functions | Xml.Document(contents as any, optional encoding as nullable number) as table
Xml.Document ใช้สำหรับแปลงเนื้อหา XML (text หรือ binary) เป็นโครงสร้างตารางลำดับชั้น ทำให้สามารถ query ข้อมูล XML ได้ง่ายเหมือน Power Query ตาราง
|
6 | 4 | 6 | |
| Date.DayOfWeekName Date functions | Date.DayOfWeekName(date as any, optional culture as nullable text) as nullable text
Date.DayOfWeekName คืนค่าชื่อวันในสัปดาห์เป็นข้อความ เหมาะสำหรับแสดงวันจากวันที่ในรูปแบบ Monday, Tuesday เป็นต้น สามารถกำหนด culture เพื่อแปลชื่อวันเป็นภาษาต่างๆ ได้
|
6 | 3 | 6 | |
| Number.Abs Number functions | Number.Abs(number as nullable number) as nullable number
หาค่าสัมบูรณ์ (Absolute Value)
|
6 | 2 | 6 | |
| Time.From Time functions | Time.From(value as any, optional culture as nullable text) as nullable time
Time.From แปลงค่าต่างๆ เช่น ข้อความ ตัวเลข DateTime เป็นค่าเวลา ฟังก์ชันนี้มีประโยชน์เมื่อต้องการแปลงข้อมูลเวลาจากรูปแบบข้อความหรือรูปแบบอื่นๆ มาเป็นค่าเวลาที่ถูกต้อง
|
6 | 2 | 6 | |
| PostgreSQL.Database Accessing data functions | = PostgreSQL.Database(server as text, database as text, [options as nullable record]) as table
PostgreSQL.Database ใช้สำหรับเชื่อมต่อฐานข้อมูล PostgreSQL และดึงรายชื่อตารางและมุมมอง
|
6 | 4 | 6 | |
| List.Accumulate List functions | List.Accumulate(list as list, seed as any, accumulator as function) as any
List.Accumulate เป็นฟังก์ชันสำหรับการวนลูปผ่านแต่ละ element ใน list พร้อมทั้งเก็บสถานะสะสมไว้ตลอดการทำงาน.โดยจะเริ่มต้นจากค่าเริ่มต้นที่กำหนด (seed value) และในแต่ละรอบของการวนลูป ฟังก์ชันจะส่งค่าสถานะปัจจุบัน (current state) พร้อมกับ element ปัจจุบันเข้าไปใน accumulator function ที่คุณกำหนดขึ้นมา เพื่อคำนวณและสร้างสถานะใหม่สำหรับรอบถัดไป.เมื่อวนลูปครบทุก element แล้ว ฟังก์ชันจะคืนค่าสถานะสุดท้ายกลับมา เหมาะสำหรับการคำนวณยอดสะสม (running totals) การรวมแบบกำหนดเอง (custom aggregations) และการสร้างรูปแบบ For-Next loop pattern ใน M language ครับ
|
6 | 9 | 8 | |
| Duration.Days Duration functions | Duration.Days(duration as duration) as nullable number
Duration.Days ดึงจำนวนวันจากค่า Duration ซึ่งมีประโยชน์เมื่อต้องการแยกส่วนวันออกจากระยะเวลาที่คำนวณได้ เช่นความต่างระหว่างสองวันที่
|
6 | 2 | 6 | |
| Text.Middle Text functions | Text.Middle(text as nullable text, start as number, optional count as nullable number) as nullable text
Text.Middle ใช้สำหรับดึงข้อความตั้งแต่ตำแหน่งที่ระบุไปจำนวนอักขระที่กำหนด หากไม่ระบุจำนวนตัวอักษร จะดึงจากตำแหน่งเริ่มต้นไปถึงท้าย
|
6 | 3 | 6 | |
| JoinKind.Type enumerations | JoinKind.Inner | JoinKind.LeftOuter | JoinKind.RightOuter | JoinKind.FullOuter | JoinKind.LeftAnti | JoinKind.RightAnti | JoinKind.LeftSemi | JoinKind.RightSemi
JoinKind.Type คือ enum ที่ระบุประเภทของการ Join (Inner, Outer, Anti, Semi) เมื่อรวมตารางข้อมูลสองตาราง ใช้กับ Table.Join เพื่อควบคุมว่าแถวไหนจะปรากฏในผลลัพธ์
|
6 | 2 | 6 | |
| List.Numbers List functions | List.Numbers(start as number, count as number, optional increment as nullable number) as list
List.Numbers สร้าง List ของตัวเลขเรียงกันตามค่าเริ่มต้น จำนวน และการเพิ่มค่า
|
6 | 3 | 6 | |
| Table.DuplicateColumn Table functions | Table.DuplicateColumn(table as table, columnName as text, newColumnName as text, optional columnType as nullable type) as table
สร้างคอลัมน์ใหม่โดยคัดลอกค่ามาจากคอลัมน์ที่มีอยู่เดิม (Duplicate)
|
6 | 2 | 6 |
ชื่อฟังก์ชันเป็นภาษาอังกฤษเสมอ ลองสะกดอีกแบบ หรือกด Enter เพื่อค้นในคำอธิบายด้วย