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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
ooctaviano
Frequent Visitor

Max Date

I need help, I'm having issues with a measure, I have a table like this

 

ooctaviano_0-1616514775547.png

 

I need a measure that brings me the last date with accidents, in this case 3/28/2021, and also the previous date with accidents.

 

I have this measure but for some reason it does not bring any date back

 

Last Date = calculate(MAX(RA[Date]),filter(RA,RA[Accidents]>0))

Also tried

Last Date = CALCULATE(MAX( RA[Date] ),FILTER( ALL( RA ), RA[Acidents] > 0 ))

but also does not work

 

It may be something with the filtres.

 

Please advise I need help

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@ooctaviano , Try a measure like

 

MAXX(filter(allselected(RA),RA[Accidents]>0),RA[Date])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@ooctaviano , Try a measure like

 

MAXX(filter(allselected(RA),RA[Accidents]>0),RA[Date])

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

I just needed to use all instead of allselected

Thanks a lot for the help

 

Same issue, still not showing the last date.

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.