Forum Discussion
rachellek
5 years agoFrequent 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 Date | Value | Target |
| 1/1/19 | 2 | 6 |
| 1/1/20 | 0 | 5 |
| 1/1/21 | 1 | 4 |
| 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
- Tanushree_Kapse
Impactful Individual
Hi rachellek
You can sort the date... as descending and apply Is not blank filter on the value.
Thanks!
- Jos_Woolley
Solution Sage
Hi,
Shouldn't you just be using:
MyMeasure = LASTNONBLANK ( 'Table'[Value], 1 )Regards