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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
realdaniel1989
Frequent Visitor

Lastnonblank not returning correct results

I'm trying to return the last non-blank row of the "Target stage outcome" column based on the "Entity" column.  However, using the lastnonblank dax formula is not yielding the correct results. 

 

I have attached the example fact table below. 

Snipaste_2022-09-28_13-57-50.png

Here is the results that I'm trying to get are those in the red box:

Snipaste_2022-09-28_13-44-32.png 

I've created a summary table to see the results

Snipaste_2022-09-28_13-50-21.png

Despite the "Index" and "Last day" returning the correct results, the "Stage" field is not returning the correct result. 

 

This is the "Target" table that I'm using in my summary table above

Snipaste_2022-09-28_13-52-44.png 

I would appreciate if someone could help me here. 

 

Thanks

 

 

1 ACCEPTED SOLUTION

try LASTNONBLANKVALUE(Target[Reponse Date],MAX(Target[Target Stage Outcome]))

View solution in original post

5 REPLIES 5
wdx223_Daniel
Super User
Super User

LASTNONBLANK, sorts the column in the first parameter, then get the last value of which the second parameter is non blank

@wdx223_Daniel Would that mean that it would sort the "target stage outcome" first then only determine the lastnonblank for the "Response date"? 

 

try LASTNONBLANKVALUE(Target[Reponse Date],MAX(Target[Target Stage Outcome]))

Thanks @wdx223_Daniel.  It worked but should there be the same date, then it doesn't work as intended.  How should I deal with it if I dont use the "Response date" field? 

how about using the Target[Index] as the first parameter?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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