The problem with using rated range is that Tesla changes the algorithm frequently. Ideal range appears to be more stable.
I put together a little spreadsheet for myself to track this. I went back to my iPhone photos and found some shots of the screens or captures of the app and from the photo got the date to get some history as well. I had some other data points from trips that I'd logged. Some of my entries have only Rated while others have only Ideal, but now, every so often, I update it with both. What I can say for myself is that other than the general downward trend, my Rated Miles don't seem to change at all. I have even noted, contrary to the reports of others, that my Rated Miles number does not change even by 1 over any firmware update I've had on my car. I only have a bit of history with Ideal Miles, but don't see much variation there yet.
If you do this while driving : all good... But the trip kWh only records while you drive and does not account for vampire drain and possibly HVAC while parked (unsure about that one)
Turning range mode on or off effects rated range displayed. That might be the reason. On average whatever rated range is displayed when range mode is off needs to be multiplied by 1.013 to estimate what rated range would be if range mode was on. Or you can just turn on range mode and see the difference yourself.