The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
I trying to implement dymnamis rls for my datamart. While saving my rls dax code, I'm getting the below error at fabric platform.
Underlying Error: {"code":"UnexpectedDatamartFailure","pbi.error":{"code":"UnexpectedDatamartFailure","parameters":{},"details":[{"code":"ModelingServiceError_Reason","detail":{"type":1,"value":"Parsing error exception at line 1 position 5: 'no viable alternative at input 'var_restriction''."}}]}}
Any leads or suggestion could be helpful!
Solved! Go to Solution.
Hi @Nashrin ,
Thank you for your update, and I appreciate you confirming this with Microsoft Support. It’s helpful to have clarity directly from the source.
As you've pointed out, datamarts in Microsoft Fabric currently don’t support dynamic Row-Level Security (RLS) using DAX expressions like USERNAME() or USERPRINCIPALNAME(). I understand this may be disappointing, especially if dynamic RLS is a key requirement for your setup.
Control access to datamarts (preview) - Power BI | Microsoft Learn
Alternatives:
Consider Using Power BI Datasets:
If dynamic RLS is critical, one option is to move your RLS logic to a Power BI dataset. Power BI datasets fully support dynamic DAX filters and provide greater flexibility for defining user-based roles.
Leverage Existing Datamart Features:
If moving to a dataset isn’t feasible, you could use static roles within the datamart's enhanced RLS editor, although this would be less dynamic.
Please let us know if you’d like help setting up RLS in a dataset or need assistance exploring alternative solutions.
Lastly, if you’ve found the reply helpful, please close this issue by marking it as the accepted solution. Doing so helps others in the community who might face similar challenges.
Best Regards,
Vinay kumar.
Hi @Nashrin ,
We haven't heard from you since the last response. If you found a solution helpful, please mark it as Accept as Solution to close this issue and help others benefit from it.
Thank you.
Hi @Nashrin ,
Apologies for the delayed response, and thank you for your patience.
I wanted to check if this issue has been resolved or if you're still encountering the error.
From the error message:
"Parsing error exception at line 1 position 5: 'no viable alternative at input 'var_restriction''."
It seems there's a parsing issue in the DAX expression you're using for Row-Level Security (RLS). This could indicate that:
The variable 'var_restriction' is not defined or initialized properly.
There might be a syntax issue in how the 'VAR' statement or subsequent logic is written.
If the issue persists, could you please share the DAX code snippet you're trying to implement? That would help us identify the root cause and provide guidance.
Also as mentioned by @lbendlin , could you clarify how Row-Level Security (RLS) is related to the datamart in your setup?
RLS can indeed be applied directly to datamarts in Power BI, as described in the Datamarts access control
If your scenario involves using RLS in the datamart itself, it would be helpful to know if you’ve already defined security roles with DAX filters, or if you need assistance with that setup.
Looking forward to your response and the DAX code snippet to assist you further!
Best Regards.
Hello,
Thank you for your reply, After connecting with microsoft support, It's been confirmed that the datamart won't support dynamic RLS.
Hi @Nashrin ,
Thank you for your update, and I appreciate you confirming this with Microsoft Support. It’s helpful to have clarity directly from the source.
As you've pointed out, datamarts in Microsoft Fabric currently don’t support dynamic Row-Level Security (RLS) using DAX expressions like USERNAME() or USERPRINCIPALNAME(). I understand this may be disappointing, especially if dynamic RLS is a key requirement for your setup.
Control access to datamarts (preview) - Power BI | Microsoft Learn
Alternatives:
Consider Using Power BI Datasets:
If dynamic RLS is critical, one option is to move your RLS logic to a Power BI dataset. Power BI datasets fully support dynamic DAX filters and provide greater flexibility for defining user-based roles.
Leverage Existing Datamart Features:
If moving to a dataset isn’t feasible, you could use static roles within the datamart's enhanced RLS editor, although this would be less dynamic.
Please let us know if you’d like help setting up RLS in a dataset or need assistance exploring alternative solutions.
Lastly, if you’ve found the reply helpful, please close this issue by marking it as the accepted solution. Doing so helps others in the community who might face similar challenges.
Best Regards,
Vinay kumar.
How is RLS related to the datamart? Is the datamart one of the sources of your semantic model?
User | Count |
---|---|
16 | |
15 | |
8 | |
7 | |
5 |
User | Count |
---|---|
34 | |
32 | |
25 | |
15 | |
11 |