What Is Power Query

Power Query is a data transformation and data preparation engine. Power Query enables you to connect, combine, and refine data sources to meet your analysis needs.

Expressions, values, and let expression

In Power Query, formulas begin with an equals sign (=) and can contain values, operators, guide, and references to other objects in a workbook. The M language used in Power Query is case-sensitive and uses let expressions to define a sequence of values that are passed to an in expression for evaluation.

Comments

Power Query supports both single-line comments (using // at the beginning of a line) and multi-line comments (enclosed between /* and */). Comments are useful for documenting your code and explaining your transformation logic.

Evaluation Model

Power Query uses a lazy evaluation model, meaning that expressions are only evaluated when their results are needed. This helps improve performance when working with large datasets. Power Query also uses query folding to push operations back to the data source when possible.

Operators

Power Query includes various operators for performing calculations and comparisons. These include arithmetic operators (+, -, *, /), comparison operators (=, <>, >, <, >=, <=), and logical operators (and, or, not). The order of operations follows standard mathematical conventions.

Types and type conversion

Power Query supports various data types including text, number, logical, date, time, datetime, duration, binary, and more. Type conversion guide like Number.From(), Text.From(), and Date.From() allow you to convert between types. The is operator can be used to check if a value is of a specific type.

Metadata

Metadata in Power Query provides additional information about values. It can be attached to any value using the meta operator and accessed using the Value.Metadata function. Common uses include describing column types, formatting information, and source data properties.

Text Formatting

Power Query provides numerous guide for working with text data, including Text.Trim(), Text.Clean(), Text.Replace(), Text.Split(), and Text.Combine(). These guide help you standardize and manipulate text values in your data transformations.

Functions

Power Query has hundreds of built-in guide across various categories including text manipulation, date/time handling, mathematical operations, list and table operations, and more. You can also create custom guide using the (parameters) => expression syntax.

Enumerations

Enumerations in Power Query are predefined sets of named values. They help provide consistent options for function parameters. Examples include Precision.Double, Order.Ascending, JoinKind.Inner, and MissingField.Error. These enumerations make code more readable and less error-prone.

Constants

Power Query includes several built-in constants such as #shared (all available guide), #sections (all sections in the current document), and #binary (binary guide). These constants provide access to important functionality and information within the Power Query environment.

About This Reference

This Power Query reference guide provides an overview of the key concepts and guide in the M language. It serves as a quick reference for users working with Power Query in Excel or Power BI. For more detailed information, refer to the official Microsoft documentation.

Functions

Access Data

Access Data functions for Power Query M language.

Binary functions

Binary functions functions for Power Query M language.

Combiner functions

Combiner functions functions for Power Query M language.

Comparer functions

Comparer functions functions for Power Query M language.

Date and time functions

Date and time functions functions for Power Query M language.

Date functions

Date functions functions for Power Query M language.

DateTimeZone functions

DateTimeZone functions functions for Power Query M language.

Duration functions

Duration functions functions for Power Query M language.

Error functions

Error functions functions for Power Query M language.

Expression functions

Expression functions functions for Power Query M language.

Function values

Function values functions for Power Query M language.

Lines functions

Lines functions functions for Power Query M language.

List functions

List functions functions for Power Query M language.

Logical functions

Logical functions functions for Power Query M language.

Number functions

Number functions functions for Power Query M language.

Record functions

Record functions functions for Power Query M language.

Replacer functions

Replacer functions functions for Power Query M language.

Splitter functions

Splitter functions functions for Power Query M language.

Table functions

Table functions functions for Power Query M language.

Text functions

Text functions functions for Power Query M language.

Time functions

Time functions functions for Power Query M language.

Type functions

Type functions functions for Power Query M language.

Uri functions

Uri functions functions for Power Query M language.

Value functions

Value functions functions for Power Query M language.