Skip to Main Content
Excel Power Pivot & Power Query For Dummies, 2nd Edition
book

Excel Power Pivot & Power Query For Dummies, 2nd Edition

by Michael Alexander
March 2022
Beginner to intermediate content levelBeginner to intermediate
288 pages
7h 21m
English
For Dummies
Content preview from Excel Power Pivot & Power Query For Dummies, 2nd Edition

Chapter 12

Extending Power Query with Custom Functions

IN THIS CHAPTER

check Making a custom function

check Using custom functions in other queries

check Creating a parameter query

Power Query records all actions using its own formula language (known as the M language). When you connect to a data source and apply transformations to that data, Power Query diligently saves your actions as M code behind the scenes in query steps. The transformation steps can then be repeated when you refresh the data in your query.

That backstage coding is relatively transparent, and can, for the most part, be ignored for most data processing activities. In this chapter, I show you how to leverage the M language to extend the capabilities of Power Query to create your own custom functions and perform truly heroic data processing.

Creating and Using a Basic Custom Function

When building a custom function for Power Query, you’re essentially doing nothing more than creating a query and manipulating its M code to return a desired result. That result can be an array, a data table, or a single value.

To help you gain a sense of the general steps taken to create a custom function, I show you now how to build a basic mathematical ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Microsoft Excel Data Analysis and Business Modeling (Office 2021 and Microsoft 365), 7th Edition

Microsoft Excel Data Analysis and Business Modeling (Office 2021 and Microsoft 365), 7th Edition

Wayne Winston
Microsoft Excel 365 Bible

Microsoft Excel 365 Bible

Michael Alexander, Dick Kusleika
Excel 2019 Bible

Excel 2019 Bible

Michael Alexander, Richard Kusleika, John Walkenbach

Publisher Resources

ISBN: 9781119844488Purchase Link