This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
I'm looking to build a measure that returns the last date where an hour is forecast. I have to have 0's in the forecast for a burndown chart measure I'm using otherwise I get odd spikes.
Currently using
I then use this:
So for the below example, A would be 18/12/19
B would be 20/12/19.
Any ideas?
| Item | Date | Hours |
| A | 18/12/19 | 1 |
| B | 18/12/19 | 0 |
| A | 19/12/19 | 0 |
| B | 19/12/19 | 2 |
| A | 20/12/19 | 0 |
| B | 20/12/19 | 1 |
| A | 23/12/19 | 0 |
| B | 23/12/19 | 0 |
Solved! Go to Solution.
Hi @Anonymous ,
Please try the measure below and see if the result achieve your expectation.
Measure =
var a = CALCULATE(MAX('Table'[Date]),FILTER(ALLEXCEPT('Table','Table'[Item]),'Table'[Hours]<>0))
return
IF(MAX('Table'[Date])=a,MAX('Table'[Hours]),BLANK())Result would be shown as below.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please try the measure below and see if the result achieve your expectation.
Measure =
var a = CALCULATE(MAX('Table'[Date]),FILTER(ALLEXCEPT('Table','Table'[Item]),'Table'[Hours]<>0))
return
IF(MAX('Table'[Date])=a,MAX('Table'[Hours]),BLANK())Result would be shown as below.
Best Regards,
Jay
Community Support Team _ Jay Wang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous add following measure to get the date
First Date =
CALCULATE(
FIRSTDATE ( hurs[Date] ),
KEEPFILTERS( hurs[Hours] = 0 )
)
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Thanks Parry2k - First date records the first 0 in the list, I'm after the item before the last 0 in the data set,
This seems to work though, so I'm pretty sure you put me on the right track!
Hi @Anonymous ,
I think your original max function should work with an added filter context. Try this as a calculated column:
CALCULATE(MAX([Date]), FILTER(BUDGET_DATA, [Item] = EARLIER([Item]) && [Hours] <> 0))
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 24 | |
| 24 | |
| 21 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 56 | |
| 53 | |
| 49 | |
| 26 | |
| 26 |