EVALUATEANDLOG is a DAX function that returns the value of the first argument and logs it in the DAX evaluation log.
Syntax
EVALUATEANDLOG(
Value,
Label,
MaxRows
)
| Argument | Properties | Description |
|---|---|---|
| Value | A scalar or table expression. | |
| Label | Optional | A string that will be shown in the log. |
| MaxRows | Optional | The maximum number of rows to output to the DAX evaluation log when the first argument is a table expression. Default is 10. |
Example 1
The following DAX query:
EVALUATE
SUMMARIZE(
EVALUATEANDLOG(FILTER(Sales, [ProductKey] = 528)),
Sales[SalesTerritoryKey],
"sum",
sum(Sales[Sales Amount])
)
Returns the following DAX Evaluation Log event:
{
"expression": "FILTER(Sales, [ProductKey] = 528)",
"inputs": [],
"outputs": ["'Sales'[SalesOrderLineKey]", "'Sales'[ResellerKey]", "'Sales'[CustomerKey]", "'Sales'[ProductKey]", "'Sales'[OrderDateKey]", "'Sales'[DueDateKey]", "'Sales'[ShipDateKey]", "'Sales'[SalesTerritoryKey]", "'Sales'[Order Quantity]", "'Sales'[Unit Price]", "'Sales'[Extended Amount]", "'Sales'[Product Standard Cost]", "'Sales'[Total Product Cost]", "'Sales'[Sales Amount]", "'Sales'[Unit Price Discount Pct]"],
"data": [
{
"input": [],
"rowCount": 3095,
"output": [
[52174001, -1, 23785, 528, 20190707, 20190717, 20190714, 1, 1, 4.99, 4.99, 1.8663, 1.8663, 4.99, 0.0],
[52173001, -1, 26278, 528, 20190707, 20190717, 20190714, 1, 1, 4.99, 4.99, 1.8663, 1.8663, 4.99, 0.0],
[52082001, -1, 23831, 528, 20190705, 20190715, 20190712, 1, 1, 4.99, 4.99, 1.8663, 1.8663, 4.99, 0.0],
[52054002, -1, 11207, 528, 20190704, 20190714, 20190711, 1, 1, 4.99, 4.99, 1.8663, 1.8663, 4.99, 0.0],
[52036001, -1, 25337, 528, 20190704, 20190714, 20190711, 1, 1, 4.99, 4.99, 1.8663, 1.8663, 4.99, 0.0],
[51939002, -1, 23670, 528, 20190702, 20190712, 20190709, 1, 1, 4.99, 4.99, 1.8663, 1.8663, 4.99, 0.0],
[51911002, -1, 11746, 528, 20190701, 20190711, 20190708, 1, 1, 4.99, 4.99, 1.8663, 1.8663, 4.99, 0.0],
[51379003, -1, 13745, 528, 20190612, 20190622, 20190619, 1, 1, 4.99, 4.99, 1.8663, 1.8663, 4.99, 0.0],
[51264002, -1, 11282, 528, 20190605, 20190615, 20190612, 1, 1, 4.99, 4.99, 1.8663, 1.8663, 4.99, 0.0],
[51184003, -1, 11263, 528, 20190531, 20190610, 20190607, 1, 1, 4.99, 4.99, 1.8663, 1.8663, 4.99, 0.0]
]
}
]
}
Example 2
The following DAX query with a scalar argument and varying attributes:
EVALUATE
SELECTCOLUMNS(
TOPN(5, Customer),
[Customer],
"Customer",
EVALUATEANDLOG([Customer] & ", " & [Country-Region], "customerLog")
)
Returns the following DAX Evaluation Log event:
{
"expression": "[Customer] & \", \" & [Country-Region]",
"label": "customerLog",
"inputs": ["'Customer'[Customer]", "'Customer'[Country-Region]"],
"data": [
{
"input": ["Russell Xie", "United States"],
"output": "Russell Xie, United States"
},
{
"input": ["Savannah Baker", "United States"],
"output": "Savannah Baker, United States"
},
{
"input": ["Maurice Tang", "United States"],
"output": "Maurice Tang, United States"
},
{
"input": ["Emily Wood", "United States"],
"output": "Emily Wood, United States"
},
{
"input": ["Meghan Hernandez", "United States"],
"output": "Meghan Hernandez, United States"
}
]
}
2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy