Hi @Enya Yang
It determines the tenant based on the user you sign in to Graph Explorer. If you want to run the query in a different tenant, then you just need to sign in with the user of the target tenant.
Hope this helps.
If the reply is helpful, please click Accept Answer and kindly upvote it. If you have additional questions about this answer, please click Comment.