Forum Discussion
Dynamic RLS - USERPRINCIPALNAME returning more than 1 criterium
- 1 year ago
hi , you should create a users and users and their variables (Supervisor and Functions) table for this , this variable table should include two column users & all the variables related to that user
and then create a relationship between user and variable table
And create this measure
SelectedValuesFilter3 = VAR SelectedValues = VALUES('User&Sup&Fun'[Value]) VAR MatchFound = SUMX( SelectedValues, IF( CONTAINSSTRING( MAX(Table2[PathF]),'User&Sup&Fun'[Value] ), 1, 0 ) ) RETURN IF(MatchFound > 0, 1, 0)I have create a new path column called pathf in here without the first part of the path but if you need it as well you can use the orginal path & Table2 include your main table name in there
And include this measure into your table filter and say you only need to see 1
And apply RLS to users table and it should work
A better approach is to use CONCATENATEX instead of MAXX, ensuring all relevant values are captured. Modify your RLS rule by using CONCATENATEX to combine multiple Supervisor or FunctionRRnr values into a single string separated by "|". Then, PATHCONTAINS can check against multiple values instead of just one. This ensures that all relevant data is included rather than just the maximum value. Let me know if you need further refinements or debugging help.
OR(
PATHCONTAINS('DIM-Organogram'[PathRLS],
CONCATENATEX(FILTER('DIM-Organogram', [Organogram.Email] = USERPRINCIPALNAME()), 'DIM-Organogram'[Supervisor], "|")
),
PATHCONTAINS('DIM-Organogram'[PathRLS],
CONCATENATEX(FILTER('DIM-Organogram', [Organogram.Email] = USERPRINCIPALNAME()), 'DIM-Organogram'[FunctionRRnr], "|")
)
)
- Nico_Beckers1 year agoFrequent Visitor
Hi prasannagoloju,
This expression filters everything out of the dataset. If I have 2 values, A and B, wont it look for A|B then in pathcontains with this formula?
Kr,
Nico