Retrieving last non zero value for daily exchange rates
I have a daily exchange rate module which store the daily rates for multiple currencies. I wanted to get the last non-zero value for each date for example we have daily exchange rates for 1 Jan 2021 but none for 2nd and 3rd of Jan 2021, so the daily exchange rates for 3 Jan 2021 should display the rates of 1 Jan 2021 since the last non-zero value for daily exchange rates is available at 1 Jan 2021.
Is there any workaround or solution for this requirement?
Any help is highly appreciated