DAX Function Guide

FIRSTNONBLANK
Empty image or helper icon

Sam McKay

CEO & Founder

How does the FIRSTNONBLANK work?
The FIRSTNONBLANK function (DAX) returns the first value in the column, column, filtered by the current context, where the expression is not blank.
FIRSTNONBLANK Formula Syntax

FIRSTNONBLANK(
     <column>,<expression>
)

How do you use the FIRSTNONBLANK?

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.

Related Blog Posts

Loading

Considerations when using the FIRSTNONBLANK?

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 .
Related Video Tutorials

Loading

Formula examples using the FIRSTNONBLANK

= FIRSTNONBLANK (Sales [Sales Amount], MIN (Sales [Date])>3/31/2015)

= CALCULATE(FIRSTNONBLANK(FactSales[Order_Date],TRUE()), FILTER(FactSales,YEAR(FactSales[Order_Date])=2014))

= CALCULATE(SUM(FactSales[Net_Sales]), FILTER(FactSales,YEAR(FactSales[Order_Date])=2014), FIRSTNONBLANK(FactSales[Order_Date],TRUE()))

Related Courses

Loading