If you want one row for each filename, reflecting a specific states and listing the most recent date then this is your friend:
select filename ,
status ,
max_date = max( dates )
from some_table t
group by filename , status
having status = '<your-desired-status-here>'
Easy!