March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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.
Solved! Go to Solution.
@alisaleh you can also use the technique defined in this blog post Solving RLS Gotchas – Prologika
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.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
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,
I've also encontared with such issue. It looks like you're trying to solve a problem when you need to apply RLS for table A at one page, but don't need that at another page. I've found a solution how to do it.
Just create a meassure where you filter records in Table A according to your conditions and put it to Filter pane but don't put it to Filter pane at another page. Be sure your Filter pane is hidden for published report.
For example, you want to exclude the personal records of the current user from Table A:
To whoever it might concern,
I had the same issue using USERELATIONSHIP() and RLS.
In my case,using INTERSECT() did not provide me with the correct results.
This is (a part) of my data Model:
Basically, I need to achieve Sum of Hours tracked on Time Tracking Table per Workorder (unique IDs).
PS: TimeTracking can be done on different levels (not necessarily on a Workorder, thats why there's no active relationship)
My original DAX was as follows:
WO Hours =
CALCULATE(
SUM('Time Tracking'[Quantity]),
USERELATIONSHIP(
Workorders[WO],
'Time Tracking'[Workorder_No]
)
)
So I have changed it to the following calculation, where it worked just fine:
WO Hours =
VAR xWO = SELECTEDVALUE(Workorders[WO],FALSE())
RETURN
IF( xWO=FALSE,
SUM('Time Tracking'[Quantity]),
CALCULATE(
SUM('Time Tracking'[Quantity]),
'Time Tracking'[Workorder_No] = xWO
)
)
Thought the measure requires much more capacity (takes longer to load), now the model is working just fine 🙂
@alisaleh exactly, glad you have a solution. Cheers!!
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.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
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.
@alisaleh you can also use the technique defined in this blog post Solving RLS Gotchas – Prologika
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.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
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()
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.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |