Forum Discussion
Datasets - Execute Query endpoint with RLS
Hi marcio_fornari,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
Hi, sorry for a long time to answer.
not work for me 😞
still return all data.
- v-kpoloju-msft1 year agoCommunity Support
Hi marcio_fornari,
Apologize for the delayed reply. Thank you for your patience and the update. I have identified few workarounds that may help resolve the issue.
Premium/Fabric Capacity: Ensure the dataset is hosted in a workspace with Premium capacity (P or A SKU) or Microsoft Fabric capacity. Note that RLS simulation via the identities field is not supported in Pro-only workspaces.RLS Roles Are Properly Defined: Confirm that the role (e.g., "SalesRegionRole") is created in Power BI Desktop under Modelling > Manage Roles and published to the service.
DAX Expressions Use USERNAME() or USERPRINCIPALNAME(): Your DAX filters within the role should utilize these functions to evaluate the username from the API call:[EmailColumn] = USERPRINCIPALNAME()
Accurate Role Name and Username in API Payload: The roles field is case-sensitive and must match precisely. The username must correspond to what your RLS expression expects (typically an email).Azure AD Token: Ensure your request includes a valid Azure AD bearer token with permission to access the dataset. Sample JSON Payload:
{ "queries": [ { "query": "EVALUATE VALUES('YourTableName')" } ], "identities": [ { "username": "[email protected]", "roles": [ "YourRoleName" ], "datasets": [ "your-dataset-guid" ] } ] }Replace 'YourTableName' with the actual table name from your dataset
'YourRoleName' with your defined role
'your-dataset-guid' with the Dataset ID (GUID)
'[email protected]' with the value your RLS rule evaluates against
Ensure the role name matches exactly what’s defined in Power BI Desktop under Manage Roles.
Please refer these links for more information:
Row-level security (RLS) with Power BI - Microsoft Fabric | Microsoft Learn
What is Power BI Premium? - Power BI | Microsoft Learn
Kindly refer to the below solved link for better understanding:
Solved: Rest API to query dataset with RLS - Microsoft Fabric CommunityIf this post helps, then please give us ‘Kudos’ and consider Accept it as a solution to help the other members find it more quickly.
Thank you for using Microsoft Community Forum.
- v-kpoloju-msft1 year agoCommunity Support
Hi marcio_fornari,
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.