Find second last max date

thanks it's help.

but if i want find the last row with some conditions ,so how can i do it in the query?
i mean find the last row when column_a>0 or b.coulmn_b>0

this is the basic query:

SELECT a.* ,LAG(LoadingDate) OVER (PARTITION BY ProductKey,GrandCustomerKey ORDER BY LoadingDate)
FROM My_Table