OpenBI Docs Buy

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> )
ParameterTypeDescription
columnColumnThe 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.
expressionExpression
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 without CALCULATE.
  • 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 monthIts amount
Actual2026-09-01194174099.21
Budget2026-12-01200646850.83
Forecast2026-12-01203495148.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 hops250.23
Malting barley5916.59

FIRSTNONBLANKVALUE, LASTNONBLANK, CLOSINGBALANCEMONTH, LASTDATE.

Last updated · OpenBI Studio 0.3.74