0 out of 2 rated this helpful - Rate this topic

FIRSTNONBLANK Function

SQL Server 2012

Returns the first value in the column, column, filtered by the current context, where the expression is not blank.


FIRSTNONBLANK(<column>,<expression>)

Term

Definition

column

A column expression.

expression

An expression evaluated for blanks for each value of column.

A table containing a single column and single row with the computed first value.

The column argument can be any of the following:

  • A reference to any column.

  • A table with a single column.

  • A Boolean expression that defines a single-column table .

Note Note

Constraints on Boolean expressions are described in the topic, CALCULATE Function.

This function is typically used to return the first value of a column for which the expression is not blank. For example, you could get the last value for which there were sales of a product.

Note Note

To understand more about how context affects the results of formulas, see Context in DAX Formulas.

This DAX function is not supported for use in DirectQuery mode. For more information about limitations in DirectQuery models, see  http://go.microsoft.com/fwlink/?LinkId=219172.

Reference

Concepts

Other Resources

Working with Relationships in Formulas
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.