EVALUATEANDLOG DAX Function (Information)

Return the value of the first argument and also log the value in DAX evaluation log.

Syntax

EVALUATEANDLOG ( <Value> [, <Label>] [, <MaxRows>] )
Parameter Attributes Description
Value

A scalar or table expression.

Label Optional

When specified, it is included in the Label column of the DAX Evaluation Log event as well as a part of the JSON payload.

MaxRows Optional

Specify the number of rows to return in case of a table expression. The default value is 10.

Return values

Scalar A single variant value.
Table An entire table or a table with one or more columns.

The value of the first argument, a scalar or a table.

Remarks

The DAX Evaluation Log is a trace event that can be captured by SQL Server Profiler or by the DAX Debug Output tool.

EVALUATEANDLOG returns the same value as its first argument, so you can place it around almost any sub-expression of a DAX expression without changing the result. The function logs the value only in Power BI Desktop. In other environments, EVALUATEANDLOG is a simple passthrough function that returns the first argument.

The log event includes the text of the first argument, the Label text, the columns of the filter context that affect the value (inputs), the output columns, and the data. If the first argument is a table expression, the event contains only the first MaxRows rows (10 if you omit MaxRows), and the event also has the real number of rows of the table. The result of the expression is not limited by MaxRows. If the event is longer than one million characters, DAX truncates it and keeps a valid JSON structure.

If DAX evaluates the first argument many times in one query, it creates a single event that contains the input values and the output values of all the evaluations. In some cases DAX does not execute the function, because of optimizations of the query plan.

» 2 related articles

Examples

--  EVALUATEANDLOG returns the same value as its first argument.
--  In Power BI Desktop, it also writes the value, with the label,
--  to the DAX Evaluation Log event. In other environments, it only
--  returns the value of the first argument.
DEFINE
    MEASURE Sales[Sales Logged] =
        EVALUATEANDLOG ( [Sales Amount], "Sales Amount" )
EVALUATE
SUMMARIZECOLUMNS (
    'Date'[Calendar Year Number],
    "Sales Amount", [Sales Amount],
    "Sales Logged", [Sales Logged]
)
ORDER BY 'Date'[Calendar Year Number]
Calendar Year Number Sales Amount Sales Logged
2007 11309946.121499848 11309946.121499848
2008 9927582.988499861 9927582.988499861
2009 9353814.867399855 9353814.867399855
--  With a table expression, MaxRows limits the rows in the log (default 10).
--  The result of the query is not limited: it has all the rows of the table.
EVALUATE
EVALUATEANDLOG (
    TOPN ( 20, VALUES ( 'Date'[Date] ), 'Date'[Date], ASC ),
    "First dates",
    3
)
ORDER BY 'Date'[Date]
Date
2005-01-01
2005-01-02
2005-01-03
2005-01-04
2005-01-05
2005-01-06
2005-01-07
2005-01-08
2005-01-09
2005-01-10
2005-01-11
2005-01-12
2005-01-13
2005-01-14
2005-01-15
2005-01-16
2005-01-17
2005-01-18
2005-01-19
2005-01-20

Related articles

Learn more about EVALUATEANDLOG in the following articles:

Last update: Nov 17, 2026   » Contribute   » Show contributors

Contributors: Alberto Ferrari, Marco Russo

Microsoft documentation: https://learn.microsoft.com/dax/evaluateandlog-function-dax

2018-2026 © SQLBI. All rights are reserved. Information coming from Microsoft documentation is property of Microsoft Corp. » Contact us   » Privacy Policy & Cookies

Context Transition

This function performs a Context Transition if called in a Row Context. Click to read more.

Row Context

This expression is executed in a Row Context. Click to read more.

Passed by Expression

This parameter is passed by expression and can be evaluated multiple times in different evaluation contexts.

Iterator

Not recommended

The use of this function is not recommended. See Remarks and Related functions for alternatives.

Not recommended

The use of this parameter is not recommended.

Deprecated

This function is deprecated. Jump to the Alternatives section to see the function to use.

Volatile

A volatile function may return a different result every time you call it, even if you provide the same arguments. Click to read more.

Deprecated

This parameter is deprecated and its use is not recommended.

DirectQuery compatibility

Limitations are placed on DAX expressions allowed in measures and calculated columns.
The state below shows the DirectQuery compatibility of the DAX function.

Contribute

Want to improve the content of EVALUATEANDLOG? Did you find any issue?
Please, report it us! All submissions will be evaluated for possible updates of the content.