FIRSTNONBLANKVALUE

Updated on

FIRSTNONBLANKVALUE is a DAX function that returns the first non-blank value of an expression evaluated for a column.

Syntax

FIRSTNONBLANKVALUE(
   ColumnName,
   Expression
)
Argument Properties Description
ColumnName The source values.
Expression The expression to be evaluated for each value.

Return Values

The first non-blank value of expression corresponding to the sorted values of column.

Remarks

  • The column argument can be any of the following:

    • A reference to any column.
    • A table with a single column.
  • This function is different from FIRSTNONBLANK in that the column is added to the filter context for the evaluation of expression.

  • This function is not supported for use in DirectQuery mode when used in calculated columns or row-level security (RLS) rules.

Example

The following DAX query,

EVALUATE 
SUMMARIZECOLUMNS(
  DimProduct[Class],
  "FNBV",
  FIRSTNONBLANKVALUE(
    DimDate[Date],
    SUM(FactInternetSales[SalesAmount])
   )
)

Returns,

DimProduct[Class] [FNBV]
L 699.0982
H 13778.24
M 1000.4375
533.83

Other functions related to FIRSTNONBLANKVALUE are:

Contribute » | Contributors: Rick de Groot
Microsoft documentation: https://learn.microsoft.com/en-us/dax/firstnonblankvalue-function-dax

2023-2024 © BI Gorilla. All rights are reserved. Information from Microsoft docs is property of Microsoft Corp. | Privacy Policy