Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I have not found a solution to do this and I'm wondering whether it is possible without creating a separate table elsewhere which includes all row level security details per user. Is there a way to access the security details I've added in PBI Service?
How have you solved this?
Solved! Go to Solution.
Hi, @AnttiKoskinen
Thanks for your quick response! Soory for that i may misunderstand your need.
If you want to see the current user's attributes on the report page, you can use the USERNAME() function to place it in the card image for display.
If you want to get the RLS name and roles you configured in the current dataset. As searched, There is no Power BI REST API endpoint for this unfortunately.
To expand on that, you can connect to the XMLA endpoint using SSMS and run some queries by MDX query. There are pros and cons. In case you want more info, here is some doco with examples:
Dynamic Management Views (DMVs) in Analysis Services | Microsoft Learn
Using the DMVs you can get roles, members, and the role filters per table, however only one view can be queried at a time with no joins allowed. I ended up building up data from the following DMVs:
$SYSTEM.TMSCHEMA_ROLES
$SYSTEM.TMSCHEMA_ROLE_MEMBERSHIPS
$SYSTEM.TMSCHEMA_TABLES
$SYSTEM.TMSCHEMA_TABLE_PERMISSIONS
For how to connect to the workspace you can refer to :
Dataset connectivity and management with the XMLA endpoint in Power BI - Power BI | Microsoft Learn
And for more information , you can refer to this:
Solved: REST API to get role names (RLS) from power bi se... - Microsoft Fabric Community
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi, @AnttiKoskinen
According to your description, do you mean you want to show user his/her active RLS on a Power BI report ?
You can show the user his/her active RLS on a Power BI report when using PBI Service datasets. You can use the "View As Roles" feature in PBI Service or "View as" In Desktop to see the data as a specific user and check if the RLS is working as expected.
For this , you can refer to :
Row-level security (RLS) with Power BI - Power BI | Microsoft Learn
How To Test RLS in Power BI Service - AzureOps
You can also access the security details you've added in PBI Service. You can add members (user or security group) to the Role you created in Power BI Desktop in PBI Service.
Row-level security (RLS) with Power BI - Power BI | Microsoft Learn
If you want to configure the dynamic RLS , you actually need to add a table to manage the right. For this , you can refer to :
Dynamic Row Level Security with Power BI Made Simple - RADACAD
Power BI Row Level Security and Dynamic RLS | by David Ding | Analytics Vidhya | Medium
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Thanks for reply and all this is good and already in use.
My need is to show user what his/her RLS attribute values are (those that I've inputed into the dataset). Is there any way to access the information so that it could be used in reporting?
Hi, @AnttiKoskinen
Thanks for your quick response! Soory for that i may misunderstand your need.
If you want to see the current user's attributes on the report page, you can use the USERNAME() function to place it in the card image for display.
If you want to get the RLS name and roles you configured in the current dataset. As searched, There is no Power BI REST API endpoint for this unfortunately.
To expand on that, you can connect to the XMLA endpoint using SSMS and run some queries by MDX query. There are pros and cons. In case you want more info, here is some doco with examples:
Dynamic Management Views (DMVs) in Analysis Services | Microsoft Learn
Using the DMVs you can get roles, members, and the role filters per table, however only one view can be queried at a time with no joins allowed. I ended up building up data from the following DMVs:
$SYSTEM.TMSCHEMA_ROLES
$SYSTEM.TMSCHEMA_ROLE_MEMBERSHIPS
$SYSTEM.TMSCHEMA_TABLES
$SYSTEM.TMSCHEMA_TABLE_PERMISSIONS
For how to connect to the workspace you can refer to :
Dataset connectivity and management with the XMLA endpoint in Power BI - Power BI | Microsoft Learn
And for more information , you can refer to this:
Solved: REST API to get role names (RLS) from power bi se... - Microsoft Fabric Community
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
106 | |
87 | |
75 | |
66 |
User | Count |
---|---|
125 | |
114 | |
98 | |
81 | |
73 |