# Operators

Updated on

Operators act as the building blocks of expressions, serving as the “verbs” that dictate what action to take on operands, which are the “nouns” or the data points being manipulated.

Take the expression 1 + 2: here, 1 and 2 are the operands, and the plus sign (+) is the operator that instructs the language to add them together. Understanding this interplay between operators and operands is important to create effective and accurate expressions.

## Types of Operators

In the Power Query M language, you’ll find a wide variety of operators to use in your expressions. But it’s important to know that not all operators work with every type of value. Some only work with their own type, while others are more flexible. This section gives you all the details you need to understand how these operators interact with different types of data.

Although there is a wide selection of operators, not all operators are compatible with each other. The following overview explains. For future reference on operators, feel free to download the cheatsheet.

### Comparison Operators

Comparison operators evaluate the relationship between two values. They are used for actions like removing rows that don’t meet a certain condition. But also for conditional statements that apply different transformations based on a condition.

Applies to: null, logical, number, time, date, datetime, datetimezone, duration, text, binary

### Arithmetic Operators

Arithmetic operators perform basic mathematical operations on numbers. They are often used when creating an expression. You see them in transformations like calculating percentages, converting currencies or subtracting values.

Looking at some of the arithmetic operators, there are a few special cases:

• The value of type `date`, `datetime` and `datetimezone` all support subtraction of addition of `duration `values.
• `Duration` values can be used for adding or subtracting values from `date`, `datetime` and `datetimezone`. But they also support division or multiplication with a `number` value.
• Unary plus or negation of values can be performed on `duration` or `number` values. You can also apply these on `null` values without an error, but the outcome will be null.

### Logical Operators

Logical operators evaluate the truth or falsehood of a statement. You see them commonly used to test multiple conditions. For example, it can test if a row meets multiple criteria before including it in a dataset.

### Concatenation Operator

Concatenation operators combine two values. They are generally used to combine multiple strings into a single one, but can also be used to combine other types of values.

Looking at some of the concatenation operators there are a few special cases:

• The operator can combine a `date` value with a `time` value to form a `datetime` value.
• Combining `record` values results in overwriting fields when duplicate field names exist.
• Combining `list` or `table` values results in combining them into a single structured value.

### List, Record, and Table Operators

A selection of operators work with values of the type List, Record and Table.

## Operator Precedence

Operators are applied in a specific order called the ‘operator precedence’. You can find the order in which operators are applied below.

Contribute » | Contributors: Rick de Groot, Brian Julius
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/operators