cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
alisaleh
Helper I
Helper I

UseRelationship() and RLS constrained

Hi All,

I'm stuck with the following error

The UseRelationship() and CrossFilter() functions may not be used when querying ‘TableA’ because it is constrained by row-level security defined on ‘TableA’ or related tables.

All I did is I created a measure on some table (TableX) that has inactive relationship (1:*) to TableA, since the relationship is inactive I used the the Userelationship function inside the calcuate. It worked for me but when I publish it other uses get the error above? I understand that both tableA and tableX have active relationship to the Project table which where the RLS filter is being applied. I need both relationship to exist to the project. How can I solve this?

Thanks for the help.

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@alisaleh you can also use the technique defined in this blog post Solving RLS Gotchas – Prologika

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

6 REPLIES 6
parry2k
Super User
Super User

@alisaleh exactly, glad you have a solution. Cheers!!

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





parry2k
Super User
Super User

@alisaleh you can also use the technique defined in this blog post Solving RLS Gotchas – Prologika

 

Follow us on LinkedIn and YouTube.gif to our YouTube channel

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make effort to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

 

Visit us at https://perytus.com, your one-stop shop for Power BI-related projects/training/consultancy.






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Hi @parry2k ,

I saw that post, and I did not understand how you can use the intersect in the place of userelationship. The userelationship is function used in Calculate. can you provide an example ?

It turns out you can use intersect in calculate function semilar to USERELATIONSHIP()

alisaleh
Helper I
Helper I

hi @Jeanxyz ,

 

Thanks for your reply. I will check the video and see if it will help. as I mentioned in my first post there is project table that both A and X are connected to and that project table is the one has the RLS. Its not that straight forward but just to simplify it because the project table is connected indirectly through other dimension table which is connected to table A and I need this relation ship to stay.

Jeanxyz
Super User
Super User

Can you check which dimension table is used to set up RLS? If table A is used to set up RLS filter (as the erro message suggests), that would indeed be risky. 

As an alternative solution, maybe you can create RLS using lookupvalue, to avoid creating any relationship. That might solve the issue.

 

https://www.youtube.com/watch?v=9wN33rTaiB4&t=498s

Helpful resources

Announcements
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.