2018-11-10 Power Query 秘密特訓「虎の穴」- Power BI 勉強会これから使っていきたい Power Query について。Power Query エディターのUI操作だけでは Power Query の真の力を得ることはできない。スクラッチで書き出すのもよいのだけど、UI操作で出力された関数とかその使われ方を知るだけでも大きく前進ですなのですよ。
23. #PowerBI #PBIJP#table 以外
当然違いがある
Table.FromColumns(lists as list, optional columns as any) as table
Table.FromList(list as list, optional splitter as nullable function,
optional columns as any, optional default as any, optional extraValues as
nullable ExtraValues.Type) as table
Table.FromRecords(records as list, optional columns as any, optional
missingField as nullable MissingField.Type) as table
Table.FromRows(rows as list, optional columns as any) as table
Table.FromValue(value as any, options as nullable record) as table
Record.ToTable(record as record) as table
27. #PowerBI #PBIJPUDF
引数なし
() => 0
引数あり
( x, y ) => x + y
( x ) => ( y ) => (x + y)
オプション引数
( value1, optional value2 ) => [ Field1 = value1, Field2 = value2 ]
データ型
( x as text, y as number ) as text => Text.Repeat( x, y )
28. #PowerBI #PBIJPUDF
クエリの中で定義する
Let
fn = ( x ) => x + 10,
prm = 10,
Result = fn( prm )
in
Result
レコードで定義もできる
let
fn =
(x) => [result = x + 10][result],
prm = 10,
Result =fn( prm )
in
Result