Forum Discussion
Embed an RLS based Direct query mode power bi report's iframe link in an web application
Hello Community,
I have created a power bi report and published it my web application, now the problem is i have to create a role based view for my dashboard i.e., when group1 manager logs in he needs to able to see only data related to his group , i have total 16 groups like this, i have seen multiple posts regarding this question but none had clear solution, I want to embed my role based , direct query mode, power bi report to be published in an web application, kindly suggest how to achive this road block..
5 Replies
- Poojara_D12Super User
Hi being_human
Create Roles in Power BI:
- Go to Modeling > Manage Roles in Power BI Desktop.
- Define roles using DAX filters, e.g., [Group] = "Group1". Repeat for all 16 groups.
Use Row-Level Security (RLS):
- Publish the report to Power BI Service.
- Assign users to roles under Security settings of the dataset.
Dynamic RLS with UPN (for dynamic filtering):
- Use USERPRINCIPALNAME() in the DAX filter to match logged-in user emails with a mapping table of groups.
Embed with Role Enforcement:
- Pass the user's Group/Email to Power BI Embedded using the embed token.
- Use the API to enforce the corresponding RLS role.
Done! The embedded report will now filter data based on the logged-in user's group.
Did I answer your question? Mark my post as a solution, this will help others!
If my response(s) assisted you in any way, don't forget to drop me a "Kudos" π
Kind Regards,
Poojara
Data Analyst | MSBI Developer | Power BI Consultant
Please Subscribe my YouTube for Beginners/Advance Concepts: https://youtube.com/@biconcepts?si=04iw9SYI2HN80HKS- being_humanRegular Visitor
Can you please share any articles or vedio link regarding it, also not getting how to achive below points
- Pass the user's Group/Email to Power BI Embedded using the embed token.
- Use the API to enforce the corresponding RLS role.
- being_humanRegular Visitor
also Poojara_D12 your response looks like chatgpt answer, kindly provide proper guidance for the question
- AnonymousNot applicable
Hi being_human
Thanks for the reply from Poojara_D12 .
I need to confirm the requirement with you. Do you mean the APP of Power BI Service? Then put the link of the report into the app? As shown in the figure below?
Best Regards,
Yulia Xu- being_humanRegular Visitor
Thank you for the reply , My web app is built on .net frame work its not an APP of Power BI Service