FUNCTION DAX Statement
The FUNCTION keyword introduces a function definition (DEFINE) in a query (also known as query function).
The syntax after FUNCTION defines a function, which can be consumed in any other expression of the same query.
A query function overrides a model function with the same name. However, its definition is only used in other query measures and functions; other model measures and functions continue to use the model measure definition.
The following example shows using a query function in a DAX query.
DEFINE FUNCTION SumTwoNumbers = ( a : INT64 VAL, b : INT64 VAL ) => a + b EVALUATE { SumTwoNumbers( 3, 2 ) } -- Result is 5
Last update: Sep 15, 2025 » Contribute » Show contributors
Contributors: Alberto Ferrari, Marco Russo