Occurrence.Type

Updated on

Occurrence.Type specifies the occurrence of an element in a sequence.

Enumeration Options

Enumerations simplify the process of selecting options within a function. To specify the Occurrence.Type, users have the option to either input the below Argument description (which provides more information) or the shorter Value (which provides a more concise representation).

ArgumentValueDescription
Occurrence.First0The position of the first occurrence of the found value is returned.
Occurrence.Last1The position of the last occurrence of the found value is returned.
Occurrence.All2A list of positions of all occurrences of the found values is returned.
Occurrence.Optional0The item is expected to appear zero or one time in the input. Provided for backward compatibility in binary functions. Preferably, use BinaryOccurrence.Optional.
Occurrence.Required1The item is expected to appear once in the input. Provided for backward compatibility in binary functions. Preferably, use BinaryOccurrence.Required.
Occurrence.Repeating2The item is expected to appear zero or more times in the input. Provided for backward compatibility in binary functions. Preferably, use BinaryOccurrence.Repeating.

Applies to

Here’s a list of functions that work with Occurrence.Type:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/powerquery-m/occurrence-type