Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
rafabelokurows
New Member

Share single report with clients, change data according to user

Hi, everyone. Sorry if this have been asked before, but I haven't found it.

 

My current company has one Power BI report for each client (few clients for now, but looking to scale).

We would like to ensure future scalability and reduced maintenance costs so ideally we would have a single report that we would share with clients, and the data structure being the same troughout all clients, we would only load data pertaining to each client based on their login information.

An important requirement: since the data volume will quickly add up, we can't load everything and then filter data where user = "xxxx", that's not a viable option.

 

Assuming we have one SQL database with data for all clients, my best idea so far is to change the SQL query based on the user.  For instance, when user from company/group = "ABC" is logged in, change SQL query to obtain data using "select * from sales where client_name = 'ABC'" and thus, obtain only data they should have access to.

Is that possible? Changing the parameters for acquiring data based on the user that's logged in.

 

From the little knowledge of Power BI I have so far, I understand I could maybe use Power BI Embedded for that, correct? But how would that "parameter switch" would work in practice?

 

Thanks in advance!

1 ACCEPTED SOLUTION
v-pgoloju
Community Support
Community Support

Hi @rafabelokurows,

 

Thank you for reaching out to the Microsoft Fabric Forum Community.

 

Yes, this can be achievable with power bi embedded.


here are the steps to Implement the approch:

1. Set Up RLS in Power BI Desktop create a role, and set a filter using USERPRINCIPALNAME() to match user identity (e.g., email). Test the role using "View as Role" to ensure correct filtering.

2. Publish to Power BI Service Click Publish in Power BI Desktop and select your workspace.

3. Register App in Azure AD In Azure Portal, register your app to get credentials (App ID & Secret) for embedding.

4. Generate Embed Token Use the Power BI REST API to create a token that passes user identity (email/client info) securely.

5. Embed Report in Your App Use Power BI Embedded to show the report in your web app. Data filters automatically per user via RLS.

The "parameter switch" works by passing the logged-in user's identity (like email or client ID) through an embed token using Power BI Embedded. Power BI uses that identity in either:

Row-Level Security (RLS) with USERPRINCIPALNAME() or CUSTOMDATA() to filter data in Import mode, or

Dynamic M Query Parameters in DirectQuery mode to modify the SQL query and load only the user’s data from the source.

 

If you find this response helpful, please consider marking it as the accepted solution and giving it a thumbs-up to support others in the community.


Thank you & regards,
Prasanna Kumar

 

View solution in original post

4 REPLIES 4
v-pgoloju
Community Support
Community Support

Hi @rafabelokurows,

 

Just a gentle reminder  has your issue been resolved? If so, we’d be grateful if you could mark the solution that worked as Accepted Solution, or feel free to share your own if you found a different fix.

This not only closes the loop on your query but also helps others in the community solve similar issues faster.

Thank you for your time and feedback!

 

Best,

Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @rafabelokurows,

 

We wanted to kindly check in to see if everything is working as expected after trying the suggested solution. If there’s anything else we can assist with, please don’t hesitate to ask.

If the issue is resolved, we’d appreciate it if you could mark the helpful reply as Accepted Solution  it helps others who might face a similar issue.

 

Warm regards,

Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @rafabelokurows,

 

Just following up to see if the solution provided was helpful in resolving your issue. Please feel free to let us know if you need any further assistance.

If the response addressed your query, kindly mark it as Accepted Solution and click Yes if you found it helpful — this will benefit others in the community as well.

 

Best regards,

Prasanna Kumar

v-pgoloju
Community Support
Community Support

Hi @rafabelokurows,

 

Thank you for reaching out to the Microsoft Fabric Forum Community.

 

Yes, this can be achievable with power bi embedded.


here are the steps to Implement the approch:

1. Set Up RLS in Power BI Desktop create a role, and set a filter using USERPRINCIPALNAME() to match user identity (e.g., email). Test the role using "View as Role" to ensure correct filtering.

2. Publish to Power BI Service Click Publish in Power BI Desktop and select your workspace.

3. Register App in Azure AD In Azure Portal, register your app to get credentials (App ID & Secret) for embedding.

4. Generate Embed Token Use the Power BI REST API to create a token that passes user identity (email/client info) securely.

5. Embed Report in Your App Use Power BI Embedded to show the report in your web app. Data filters automatically per user via RLS.

The "parameter switch" works by passing the logged-in user's identity (like email or client ID) through an embed token using Power BI Embedded. Power BI uses that identity in either:

Row-Level Security (RLS) with USERPRINCIPALNAME() or CUSTOMDATA() to filter data in Import mode, or

Dynamic M Query Parameters in DirectQuery mode to modify the SQL query and load only the user’s data from the source.

 

If you find this response helpful, please consider marking it as the accepted solution and giving it a thumbs-up to support others in the community.


Thank you & regards,
Prasanna Kumar

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.