RTC resetting whenever power to the MCU is lost on R7FA6E10F2CFP

I am having an issue with the RTC. When I lose power the RTC resets every time. I use the 'g_rtc0.p_api->open(g_rtc0.p_ctrl, g_rtc0.p_cfg);' API, but I am still not able to retain the correct date and time.