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.
Hi,
This is again a non-solution. Removing the UseRelationship function from your measure without replacing it with something else will return other results. Can you verify if TREATAS is accepted as a valid replacement for these cases? Or will this cause similar issues?
I dont know if TREATAS is an valid replacement from Microsoft, but in my models have switched to TREATAS and it seems to work as UseRelationship used to work before. (No error messages or changed behaviors).
- AlexNL1 year agoAdvocate II
MarkDenHeijer Can you please send the syntax for this replacement? I am not sure if I understand it correctly. THANK YOU
- MarkDenHeijer1 year agoFrequent Visitor
The quickest way is to ask co-pilot or chat-gpt to just rewrite the measures for you. This prompt works for me:
I want to rewrite measures in PowerBI. For every measure I give you, I want you to replace the USERELATIONSHIP by a TREATAS version.
Please add the supplied query in the end and place them between /* and */.
This is the first measure I want you to rewrite:{and then you paste your dax measure here}. You can keep copying pasting new measures.
- mostvp1231 year agoKudo Collector
A note that while the TREATAS function will give you the same result, the performance will be much slower than USERELATIONSHIP. TREATAS is creating a "virtual" relationship which is more compitationally intensive. This may not matter if your model is small, but if you have a complex model (like I did) this would not have been feasible.
In my case duplicating my dimensional table which had the RLS applied to it, one time for each role, and then using an active relationship to my fact tables instead, worked great and actually improved the performance of my model. Dimensional tables are usually small so the duplication did not increase my file size much at all.