My Passport 1T WDBBEP0010BSL appears to be empty

I have had this portable 1T My Passport plugged into my laptop dock for about a year, only access very rarely but have never had issues with it. Today, it appears as drive D: with no name, used to actually say “My Passport”, don’t recall if it was always drive D. When I select it, it tells me it needs formatted, which I did NOT do. I installed the Western Digital Dashboard, and it can see the drive - but it shows:
Capacity
Total: 1000.2 GB
Free: 1000.2 GB
Used: 0 GB
Unallocated: 0 GB
Other: 0 GB

Has something caused all of my data to be erased from this drive? Anything that can be done to recover?

The drive seems like accidentally formatted and that’s why it is not showing any data. In that case, you can try recovering data from previous backups, however, if you don’t have backups then using data recovery software is the only option. Here, I suggest you to check the below link for the list of top data recovery software for windows as well as Mac systems:

https://www.softwaretestinghelp.com/best-data-recovery-software/

Hope it helps!