Forum Discussion

Nico_Beckers's avatar
Nico_Beckers
Frequent Visitor
1 year ago
Solved

Dynamic RLS - USERPRINCIPALNAME returning more than 1 criterium

Hello,    I'm having difficulties adjusting my current RLS statement:   OR(PATHCONTAINS('DIM-Organogram'[PathRLS], MAXX(FILTER('DIM-Organogram', [Organogram.Email] = USERPRINCIPALNAME()), 'DIM-Or...
  • kushanNa's avatar
    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