OpenBI Docs Buy

FIRSTNONBLANKVALUE

An expression's first value that is not blank, over a column's values in their order.

Group: Time intelligence. Compatible with DAX.

Syntax

FIRSTNONBLANKVALUE ( <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, with the value as a filter, until it is not blank.

Returns

Same type as the expression. The expression's first result that is not blank.

Remarks

  • The values are those visible in the filter context, smallest first.
  • Unlike FIRSTNONBLANK, the expression is evaluated with each value as a filter, so a plain aggregation such as SUM ( Ledger[Amount] ) 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.
  • When every result is blank, the answer is BLANK.

Examples

The first month's amount, by scenario

EVALUATE
SUMMARIZECOLUMNS (
    Ledger[Scenario],
    "First month", FIRSTNONBLANK ( Periods[Month], [Booked amount] ),
    "Its amount", FIRSTNONBLANKVALUE ( Periods[Month], [Booked amount] )
)
ORDER BY Ledger[Scenario]
Ledger[Scenario]First monthIts amount
Actual2024-01-01166021861.31
Budget2024-01-01170269757.42
Forecast2026-01-01178535432.21

The first price quoted

EVALUATE
SUMMARIZECOLUMNS (
    Prices[Commodity],
    "First price", FIRSTNONBLANKVALUE ( Prices[Date], MAX ( Prices[Close] ) )
)
ORDER BY Prices[Commodity]
Prices[Commodity]First price
Aroma hops411.65
Malting barley2642.72

LASTNONBLANKVALUE, FIRSTNONBLANK, OPENINGBALANCEMONTH, CALCULATE.

Last updated · OpenBI Studio 0.3.74