Forum Discussion
Power BI Embedded: Multiple Users Seeing the Last Logged-In District's Data
Hi,
We have a Power BI report embedded in our .NET application. We use DirectQuery, and our SQL Server production environment contains around 1,800 databases. In Power BI, we pass a database parameter to connect the report to the appropriate district's database.
Each user belongs to a specific district, and the report should display data only from their respective district/database.
We are facing an issue when multiple users log in at the same time.
For example, User A logs in from District A, and the report connects to the District A database and displays the correct data.
Then User B logs in from District B, and the report connects to the District B database.
After User B logs in, User A also starts seeing District B data.
It appears that the last-loaded database parameter value is being used by all users instead of maintaining a separate database parameter value for each user's embedded report session.
We are using Power BI Embedded with a .NET application and DirectQuery, with approximately 1,800 SQL databases in production.
What is the recommended approach for this scenario? How can we ensure that each user's embedded Power BI report independently uses the correct database parameter without affecting other users?
Would Dynamic RLS, effective identity, separate embed tokens, or another Power BI Embedded approach be appropriate for this architecture?
Any guidance on how Power BI handles parameters and DirectQuery connections for multiple concurrent embedded users would be greatly appreciated.
Thanks!
3 Replies
- v-csrikanthCommunity Support
Please check the above solution for your ask and let me know if you have any other issue.
- Bhavik13101991New Member
We also use an on-premises data gateway. The gateway data source connection is updated dynamically using the Power BI Update Datasource REST API. Based on the server and database values, we update the corresponding database parameter in the Power BI report.
- v-csrikanthCommunity Support
Thanks for describing the scenario clearly. The behaviour is consistent with how Power BI semantic model parameters work.
The parameter belongs to the shared semantic model, not to an individual user or embed session. Therefore, when User B changes the parameter to District B, the shared model configuration changes, which can cause User A to receive District B data. This should be treated as a data-isolation risk.
Also, Gateways - Update Datasource updates gateway datasource credentials; it is not intended to change the server/database connection.
Recpomended approach:- RLS / Effective Identity: Controls row-level access within a model; it does not switch a DirectQuery model between databases.
- Dynamic M query parameters: Not supported for switching data sources in the Power BI service.
- Separate embed tokens: Provide identity/permissions but don't create isolated model parameters.
For ~1,800 district databases, I recommend:
- One semantic model per district, configured once against its database, rather than changing a shared model parameter at login.
- Use service principal profiles to manage the large number of customer workspaces. Microsoft documents a 1,000-workspace limit per embedding identity; exceeding it puts the application into an unsupported state.
- Maintain one report and use dynamic binding to connect it to the appropriate district semantic model at embed time. Note the documented 1,000-data-source limit per user for dynamic binding, which should be considered in the final architecture.
- If the databases can eventually be consolidated, a single semantic model with dynamic RLS can be considered instead.
Thanks,
C Srikanth
Community Support Team.