Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
saanchi2804
Helper I
Helper I

Last Non-Blank Value

Hi,

 

Could someone please help me understand the syntax of this function? I do not understand why do we need a column name in the syntax when the second element of the sytanx is all we need?

 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @saanchi2804 ,

 

The Lastnoblankvalue() function iterates all the values in the column provided as the first argument. For each value it evaluates the expression provided in the second argument, returning the largest value included in the first argument that generated a non-blank result as it was evaluating the expression provided in the second argument. And this is an iterative function that generates the row context, and second parameter is calculated in the row context.

 

About context in Dax:

Understanding Evaluation Context in DAX - BI Gorilla
Microsoft Power BI: Deep dive into DAX evaluation context - BRK3060 - YouTube

 

For the Lastnoblankvalue() function, you can see the following link to see it in action and some examples:

LASTNONBLANKVALUE – DAX Guide

Firstnonblankvalue and Lastnonblankvalue - Microsoft Power BI Community

LASTNONBLANK & FIRSTNONBLANK - How To Use This Two... - Microsoft Power BI Community

Optimizing LASTNONBLANK and LASTNONBLANKVALUE calculations - SQLBI

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-yangliu-msft
Community Support
Community Support

Hi  @saanchi2804 ,

 

The Lastnoblankvalue() function iterates all the values in the column provided as the first argument. For each value it evaluates the expression provided in the second argument, returning the largest value included in the first argument that generated a non-blank result as it was evaluating the expression provided in the second argument. And this is an iterative function that generates the row context, and second parameter is calculated in the row context.

 

About context in Dax:

Understanding Evaluation Context in DAX - BI Gorilla
Microsoft Power BI: Deep dive into DAX evaluation context - BRK3060 - YouTube

 

For the Lastnoblankvalue() function, you can see the following link to see it in action and some examples:

LASTNONBLANKVALUE – DAX Guide

Firstnonblankvalue and Lastnonblankvalue - Microsoft Power BI Community

LASTNONBLANK & FIRSTNONBLANK - How To Use This Two... - Microsoft Power BI Community

Optimizing LASTNONBLANK and LASTNONBLANKVALUE calculations - SQLBI

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

JW_van_Holst
Resolver IV
Resolver IV

LASTNONBLANK is an interator and thus it needs a column to iterate over (1st argument) and and an expression to evaluate (the 2nd argument).

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors