Forum Discussion

JB_AT's avatar
JB_AT
Helper III
2 years ago
Solved

RLS based on Date Range

Good evening   I want to implement a RLS solution that uses USERPRINCIPALNAME and a date range.   I have an RLS table that has the Email of the people who are allowed to see certain parts of the ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi JB_AT ,

    You can try this:

    =IF(
        Sales[Date] >= RLS[FromDate],
        IF(
            Sales[Date] <= RLS[ToDate],
            IF(
                RLS[Email] = USERPRINCIPALNAME(),
                1,
                0
            ),
            0
        ),
        0
    )

    Best Regards,

    Xianda Tang

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