EDIT
You can try something like:
=sum(filter(C2M2:CM,D2:D="Store 1",A2:A=max(filter(A2:A,B2D2:B="StoreD="Store 1"))))
The inner filter
returns every row in A2:A (dates) where B2D2:BD (stores) contains 'Store 1'), we then take the max
of this and use it in the outer filter
to return every row in C2M2:CM (sales) where A2:A matches that maximum date (and D2:D still contains 'Store 1'), then finally we take the sum
of those values.