How to display number of issues which are in particular status for period of time

Hi Team,
I want to prepare a report that are in status ToDo, In Progress for each month. If the issue is moved from ToDo to In Progress & Closed in Same month, then it should take last status and should not show count in In Progress.

I have another issue that Report shows only the issue which are opened now. I would like to take a report of past year/month, which are closed, but the issue history is not showing count in report.

I understand that I could use the Calculated Measure which I tried, but it doesn’t give correct result. I used below expression and tried some combination, but it doesn’t give correct result
[Measures].[Issues history],
[Transition Status].[In Progress]