LASTNONBLANKVALUE

Updated on

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

Syntax

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

Return Values

The last 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 LASTNONBLANK 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],
  "LNBV",
  LASTNONBLANKVALUE(
    DimDate[Date],
    SUM(FactInternetSales[SalesAmount])
   )
)

Returns,

DimProduct[Class] [LNBV]
L 132.44
H 137.6
M 84.97
2288.6

Other functions related to LASTNONBLANKVALUE are:

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

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