Forum Discussion
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?
- Anonymous3 years ago
Hi Anonymous ,
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 - YouTubeFor the Lastnoblankvalue() function, you can see the following link to see it in action and some examples:
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.
2 Replies
- JW_van_HolstResolver 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).
- AnonymousNot applicable
Hi Anonymous ,
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 - YouTubeFor the Lastnoblankvalue() function, you can see the following link to see it in action and some examples:
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.