Function.From

Updated on

Function.From is a Power Query M function that takes a unary function and creates a new function with the specified type that constructs a list out of its arguments and passes it to the original function. The function returns the new function.

Compatible with: Power BI Service Power BI Desktop Excel Microsoft 365

Syntax

Function.From(
   functionType as type,
   function as function,
) as function

Description

Takes a unary function function and creates a new function with the type functionType that constructs a list out of its arguments and passes it to function.

Examples

Converts List.Sum into a two-argument function whose arguments are added together

// Output: 3
Function.From( type function ( a as number, b as number ) as number, List.Sum )( 2, 1 )

Converts a function taking a list into a two-argument function

// Output: "21"
Function.From( type function ( a as text, b as text ) as text, ( list ) => list{0} & list{1} )( "2", "1" )

Other functions related to Function.From are:

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