LASTNONBLANKVALUE
An expression's last value that is not blank, over a column's values in their order.
Group: Time intelligence. Compatible with DAX.
Syntax
LASTNONBLANKVALUE ( <column>, <expression> )
| Parameter | Type | Description |
|---|---|---|
column | Column | The column whose values are gone through, in their sort order: dates, numbers or text. A table of one model column, such as VALUES ( Periods[Month] ), works too. |
expression | Expression evaluated for each row | Worked out for each value, from the last, with the value as a filter, until it is not blank. |
Returns
Same type as the expression. The expression's last result that is not blank.
Remarks
- The values are those visible in the filter context, largest first.
- Unlike
LASTNONBLANK, the expression is evaluated with each value as a filter, so a plain aggregation works withoutCALCULATE. - The column must be one of the model, or a table of one such as
VALUES; a table made in the query is an error, as in Power BI. - It is the latest known value: unlike
CLOSINGBALANCEMONTH, which reads one date only, it looks back to the last date that has a value. - When every result is blank, the answer is BLANK.
Examples
The latest amount of each scenario
The actuals stop in September 2026, the budget and the forecast run to December.
EVALUATE
SUMMARIZECOLUMNS (
Ledger[Scenario],
"Last month", LASTNONBLANK ( Periods[Month], [Booked amount] ),
"Its amount", LASTNONBLANKVALUE ( Periods[Month], [Booked amount] )
)
ORDER BY Ledger[Scenario]
| Ledger[Scenario] | Last month | Its amount |
|---|---|---|
| Actual | 2026-09-01 | 194174099.21 |
| Budget | 2026-12-01 | 200646850.83 |
| Forecast | 2026-12-01 | 203495148.31 |
The latest price, with a plain aggregation
EVALUATE
SUMMARIZECOLUMNS (
Prices[Commodity],
"Latest price", LASTNONBLANKVALUE ( Prices[Date], MAX ( Prices[Close] ) )
)
ORDER BY Prices[Commodity]
| Prices[Commodity] | Latest price |
|---|---|
| Aroma hops | 250.23 |
| Malting barley | 5916.59 |
Related functions
FIRSTNONBLANKVALUE, LASTNONBLANK, CLOSINGBALANCEMONTH, LASTDATE.