Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
Hi Guys
I created the below expression for RLS and it worked perfectly for my imported tables but when using the same for Direct Query it is giving me an error.
kindly help in sorting this as I'm stuck with this issue.
[CompanyId]=
CALCULATE (
MAX ( Deals[CompanyId] ),
FILTER ( Users, Users[LoginLevelName] = "Owner")
)
Error:
Regards,
Himanshu
Hi @Anonymous ,
Based on my test,the RLS rule works in direct query:
My original table is as below:
And my RLS rule is :
And you will see that it works after clicking test as a role:
No error returns.
But if you are having an issue,you could try to separate the rule as below:
Then create a measure :
_Value = CALCULATE(MAX(TEST[Value]),FILTER(ALL(TEST),'TEST'[Country]=SELECTEDVALUE(TEST[Country])))
You will also see:
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!
Hi @Anonymous
Direct Query mode comes with limitations, Including using measures
https://docs.microsoft.com/en-us/power-bi/connect-data/desktop-use-directquery
I recommend using the Power BI desktop feature to implement RLS
https://docs.microsoft.com/en-us/power-bi/admin/service-admin-rls
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
It doesnt solve the issue.
Is there a way I can change this expression as per the Direct query?
[CompanyId]=
CALCULATE (
MAX ( Deals[CompanyId] ),
FILTER ( Users, Users[LoginLevelName] = "Owner")
)
Regards,
Himanshu
Nothing wrong with the measure! but CALCULATE is not allowed in RLS
Did you try to implement RLS through the desktop instead of measure? if it didn't work then you might need to change the Mode of connection to Import mode at least for the User Table. But still you will need to use the RLS of the desktop.
Regards
Amine Jerbi
If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook
@Anonymous , check ,if this video from guyinacube can help ?
https://guyinacube.com/2016/06/07/row-level-security-for-cloud-models-and-directquery-in-power-bi/
Hi Amit,
Hope you're doing good.
This video doesn't help as I'm doing RLS at Desktop level and the video shows RLS functionality as Service level.
Regards,
Himanshu
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 56 | |
| 39 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 73 | |
| 70 | |
| 37 | |
| 35 | |
| 26 |