Forum Discussion
Alternative to USERELATIONSHIP due to Row Level Security?
Hi backflash ,
In the Document mentioned: USERELATIONSHIP cannot be used when row level security is defined for the table in which the measure is included.
The INTERSECT function returns a table containing only the rows that are present in both table expressions as arguments. Both tables must have the same number of columns and data types, and the columns are combined by position in their respective tables. The first parameter defines the name of the column in the result, and subsequent parameters can modify the number of rows returned without affecting the column names.
The following points need to be noted when using the INTERSECT function.
1. The parameters of INTERSECT are not interchangeable. Usually, the result of INTERSECT(T1, T2) has a different meaning than the result of INTERSECT(T2, T1).
2. Keep duplicate rows. If a row appears in both parameters of INTERSECT, then it and all its identical rows in the Left Table are returned.
3. The column names of the returned table match the column names in the Left Table. Having data along in the Left Table is independent of the columns along in the second table. For example, if the first column of the Left Table has an inheritance to the model's column C1, INTERSECT removes those rows that exist only on the Right Table and leaves the inheritance of the base column C1 unchanged.
4. Columns are compared according to their position, and no forced type conversion is performed for data comparison.
5. The returned table does not include the columns of the table associated with the LeftTable, i.e., extended table theory is not supported.
You can use the technique defined in this blog post Solving RLS Gotchas – Prologika
How to Maximize The Use of INTERSECT Function - Advanced DAX (enterprisedna.co)
I hope this link will help to resolve your problem,
Solved: USERELATIONSHIP() and RLS - Microsoft Power BI Community
Solved: UseRelationship() and RLS constrained - Microsoft Power BI Community
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.