Power Query intermedio en 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
Expresión let con 1 paso
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"
Expresión let con dos pasos
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"
Expresión let con tres pasos
Primitivo
[ID = 1, Name = "A"]
Estructurado
Lista:
List = {1,2,3}
Registro:
Record = [Column1=1,Column2=2]
Tabla:
Table = #table({"Column A","Column B"},
{{1,10},{2,20}})
Función:
Sintaxis de función personalizada:
= (Variable as Data Type, Variable as Data Type) => (Output Expression)
Ejemplo simple de función personalizada:
let
MyFunction = (x) => x + 1
in
MyFunction(10)


Power Query intermedio en Excel