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
rachellek
Frequent Visitor

Measure showing latest non-empty value, when later, empty, dates exist

I'm trying to write a measure which shows the most recent non-empty value.

 

My data looks like:

Year Start DateValueTarget
1/1/1926
1/1/2005
1/1/2114
1/1/22 3

 

 

I've tried using
Measure = CALCULATE(sum('Table'[Value]),LASTNONBLANK('Table'[Year Start Date], 1))
 
But it only returns Blank. I would like it to return the 1 from the example. 
 
Is there a way of doing this in DAX?
 
 
 
2 REPLIES 2
Jos_Woolley
Solution Sage
Solution Sage

Hi,

Shouldn't you just be using:

 

MyMeasure =
LASTNONBLANK ( 'Table'[Value], 1 )

 

Regards

Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @rachellek 

 

You can sort the date... as descending and apply Is not blank filter on the value.

Tanushree_Kapse_0-1627890312031.png

 

 

Thanks!

 

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.

Top Solution Authors