Forum Discussion
Accessing data from 2 different tenants in graph API yields the same data.
- 1 year ago
Hi jasonyeung87,
Thank you for reaching out to the Microsoft Fabric Forum Community.
The issue you're facing with both queries returning data from the same tenant is usually due to token reuse or shared query logic within Power BI. Even though you've defined separate credentials for each tenant, Power BI might be reusing the same access token or cached query steps, causing both queries to execute within the context of a single tenant.
Instead of using shared queries or functions and swapping parameters, create completely separate queries for each tenant. Each query should independently handle its authentication and data retrieval process without referencing any common steps. This ensures the correct access token is used and each query operates strictly within its intended tenant’s context.
If this post helps, please give us ‘Kudos’ and consider accepting it as a solution to help other members find it more quickly.
Thank you.
Hi jasonyeung87,
I hope this information is helpful. Please let me know if you have any further questions or if you'd like to discuss this further. If this answers your question, please Accept it as a solution and give it a 'Kudos' so others can find it easily.
Thank you.
Hi v-saisrao-msft ,
Thanks for your help on this. I had tried to separate the authentication and tokens, but as the queries are almost identical, it was always grabbing the same information.
To make it easier, I ended up creating a few Power Automate flows (one for each tenant) which calls the Graph API's and save the results in a SharePoint list (e.g. this would act like a pseudo database of license / user information). The Power BI report will then query the SharePoint list to display the data.
Jason