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" )
Related functions
Other functions related to Function.From are:
- Function.Invoke
- Function.InvokeAfter
- Function.InvokeWithErrorContext
- Function.IsDataSource
- Function.ScalarVector
2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy