Forum Discussion
RLS and USERELATIONSHIP problem
- 1 year ago
Hi ju97,
Thank you for bringing this issue to our attention. We understand that the error related to the UseRelationship() and CrossFilter() functions has recently impacted your report, despite it functioning well previously.
As this is a known issue that is currently being addressed, we are unable to keep this thread open indefinitely.For official updates, you can check for more information through the provided link : Known issue - Reports that use functions with RLS don't work - Microsoft Fabric | Microsoft Learn
In the meantime, if you continue to experience difficulties, we kindly encourage you to create a new thread. This will allow us to assist you more effectively.
Thank you for your understanding, and please know that we are here to help!
Best regards,
Atheeq.
I got this explanation from Microsoft:
"
as mentioned in the below public documentations this is a limitation with the feature, this do not necessarily mean that the functionality will not work, it just means that it is a scenario which was not tested by our Product Group, and hence there are no guarantees whatsoever for the present or for the future that it should be working now or will continue to work in the future, because it is unsupported.
USERELATIONSHIP cannot be used when row level security is defined for the table in which the measure is included.
https://learn.microsoft.com/en-us/dax/userelationship-function-dax#remarks
CROSSFILTER is not supported for Row-level security. Please refer to the below document:
https://learn.microsoft.com/en-us/dax/crossfilter-function-dax#remarks
>We suggest you to avoid using UseRelationship() and CrossFilter() in measures or calculations that are affected by RLS.
Product Group reserves the right to make any breaking changes to it without any pre-notice anywhere, because it is something that no users should ever be using in any circumstances.
Please note that if you are using unsupported feature you are at risk of having their solution broken at any point of time without any pre-notice and without us being able to support you in any way.
"
Interesting. I guess the use of inactive relationships only, was a loophole which has now been closed. Still not sure I understand the rationale behind this decision, as having no active relationships between the RLS Dim table and the fact table does not trigger RLS behavior.
To fix the bug, I had to completely rebuild my model - For each role I now have a separate Dim table, which is linked via a one to many active relationship to my fact table. This allows me to have the same measures and calculations, without needing to use USERELATIONSHIP. The result works, although I now have a Dim table which is duplicated 7 times. I suppose it is what it is - hope this can help someone who is having the same issue and built their model like I did.