Power Query nâng cao trong Excel
Lyndsay Girard
Performance Analytics Consultant
let
Source = ""
in
Source
let
MyTable = Table.FromRecords({
[ID = 1, Name = "A", Result = 10],
[ID = 2, Name = "B", Result = 5]})
in
MyTable
Biểu thức let với 1 bước
let
MyTable = Table.FromRecords({
[ID = 1, Name = "A", Result = 10],
[ID = 2, Name = "B", Result = 5]}),
#"Sorted Rows" = Table.Sort(MyTable,{{"Result", Order.Ascending}})
in
#"Sorted Rows"
Biểu thức let với 2 bước
let
MyTable = Table.FromRecords({
[ID = 1, Name = "A", Result = 10],
[ID = 2, Name = "B", Result = 5]}),
#"Sort" = Table.Sort(MyTable,{{"Result", Order.Ascending}}),
#"Lower" = Table.TransformColumns(#"Sort",{{"Name", Text.Lower, type text}})
in
#"Lower"
Biểu thức let với 3 bước
Nguyên thủy
[ID = 1, Name = "A"]
Cấu trúc
Danh sách:
List = {1,2,3}
Bản ghi:
Record = [Column1=1,Column2=2]
Bảng:
Table = #table({"Column A","Column B"},
{{1,10},{2,20}})
Hàm:
Cú pháp hàm tùy chỉnh:
= (Variable as Data Type, Variable as Data Type) => (Output Expression)
Ví dụ hàm tùy chỉnh đơn giản:
let
MyFunction = (x) => x + 1
in
MyFunction(10)


Power Query nâng cao trong Excel