Office 365 usage data for several workloads is available through the Microsoft Graph. A PowerShell script is available to grab Graph data and use it to figure out if accounts are in active use. V1.2 of GetGraphUserStatisticsReport.PS1 is available in GitHub and should be better performing when processing thousands of accounts.
The Teams desktop and browser clients now boasts the ability to report per-team and cross-team analytics. The information is interesting (at least the first time you look at it), but some doubts remain about its accuracy when the different methods of reporting are checked against each other. I’m sure it’s nothing more than timing, synchronization, or something else getting in the way.