Forum Discussion

MahammadJafar27's avatar
MahammadJafar27
Advocate I
2 years ago
Solved

Need help to implement the Dynamic RLS based on the below scenario.

RLS table --     Line 1, the user [email protected] has access to region Canada, Country Canada, Category Bikes and for All the Products. Line 2, the user [email protected] has access to region US, for All...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi MahammadJafar27 

    Try the following measure, remove the rule in user table, and create a new rule in fact table.

    COUNTROWS (
            FILTER (
                RLS,[User] = USERPRINCIPALNAME()&&
                CONTAINSSTRING ( [Region_Type], EARLIER ( 'Fact'[Region] ) )
                    && CONTAINSSTRING ( [Category_type], EARLIER ( 'Fact'[Category] ) )
                    && CONTAINSSTRING ( [Country_type], EARLIER ( 'Fact'[Country] ) )
                    && CONTAINSSTRING ( [Pro_Type], EARLIER ( 'Fact'[Product] ) )
            )
        )=1

     

    Then test it.

     

    Best Regards!

    Yolo Zhu

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.