Apply a List of Functions to a Column of Data to Create a Summary of Statistics in Power Query

Описание к видео Apply a List of Functions to a Column of Data to Create a Summary of Statistics in Power Query

#power_query #powerquery

These steps can be used create a summary of statistics:

1. Create/Import Table of Data (T1)
2. Create list of functions, then wrap each in quotations to make text (LT)
3. Convert text to functions using List.Transform and Expression.Evaluate
4. Put list of functions and results in a table using Table.FromColumns


Advanced Editor Code:
let
Source = null,
T1 = #table(type table[Data =Number.Type],{{10.15}, {11.23}, {9.78}, {9.99}, {9.84}, {10.67}, {10.36}, {9.73}, {10.19}, {10.79}, {10.62}, {10.07}, {10.21}, {9.99}, {10.53}, {9.38}, {9.94}, {9.52}, {10.23}, {10.72}, {10.34}, {9.82}, {10.65}, {10.06}, {9.45}, {10.41}, {10.14}, {9.95}, {10.52}, {10.09}, {10.62}, {10.28}, {9.68}, {9.94}, {9.96}, {10.47}, {9.73}, {10.01}, {10.31}, {9.97}, {10.18}, {9.24}, {10.54}, {10.37}, {9.67}, {10.14}, {9.91}, {9.57}, {10.17}, {10.05}, {10.29}, {10.12}}),
LT = {"List.Sum", "List.Count", "List.Average", "List.StandardDeviation"},
LF = List.Transform(LT, each Expression.Evaluate(_,#shared)),
Custom1 = Table.FromColumns({LT,List.Transform(LF, each _(T1[Data]))},{"Function", "Value"})
in
Custom1


Hyperfun by Kevin MacLeod is licensed under a Creative Commons Attribution 4.0 license. https://creativecommons.org/licenses/...

Source: http://incompetech.com/music/royalty-...

Artist: http://incompetech.com/

Комментарии

Информация по комментариям в разработке