Custom Functions in Power Query By Yury Tokarev Perth Modern Excel & Power BI User Group
Agenda Build from scratch Connect to a range Retrieve data Transform before appending Create a loop
What is a Function?
Vending machine
MAX(1,2)=2
Reference to Single Cell Use function to get value from cell
Get Data from Range Single Cell Table
Dates as parameters
Inconsistent Data from Folder Create Query from single file Transform – do not set data types Convert to Function Create Query from Folder Place function into new column as second step Expand records
Loop Table Names & Combine Data Use recursive function Function arguments: Index, List of Tables, Resulting Table The function calls itself several times and combines resulting tables
Recursive Function Steps Calculate number of tables in the list Return combined table if all iterations are done First iteration: Retrieve data from first table only + Increment Index Next iterations: retrieve data from other tables and combine + Increment Index
Q&A
Thank you!