According to our Help Center, retention rate is calculated with the following formula:

So what this means is that is we want for example to calculate the rate until March 2023, we'll take into consideration the Headcount and Leavers of April 2022 up until March 2023.
Now, the top part of the equation tells us we need the number of employees who STAYED the entire period of April 2022 to March 2023 - how do we discover this number?
(Headcount of April 2022) - [(Total number of terminated employees from April 2022 to March 2023 - Terminated employees who STARTED and LEFT within this same period)].
To get the number of Terminated employees who STARTED and LEFT within this same period, we can run a report with the following filters:
Start date: after: 01/04/2022 (for this example of course)
Lifecycle status: Employed and Terminated
Termination date: Exists.

So now that we have the number for: (Headcount of April 2022) - [(Total number of terminated employees from April 2022 to March 2023 - Terminated employees who STARTED and LEFT within this same period)], we divide this for (Headcount of April 2022) and multiply by 100 - that's the formula!