RLS on Azure Analysis service

farooq' s 0 Reputation points
2024-07-15T12:12:21.4833333+00:00

I have a fact table and 3 dim table partner ,region and user and my user table contains the usernames and there respective access i:e user1 amazon and America , user2 flipkar and canada , so when ever user 1 logs in he should only see amazon and America data.

Azure Analysis Services
Azure Analysis Services
An Azure service that provides an enterprise-grade analytics engine.
444 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 19,626 Reputation points
    2024-07-15T12:30:41.3766667+00:00

    Create a new role "UserSecurity". Then in the "Row Filters" tab for your role, add filters for each table.

    Partner dimension :

    Partner[PartnerName] = LOOKUPVALUE(User[PartnerAccess], User[Username], USERNAME())
    

    Region dimension :

    Region[RegionName] = LOOKUPVALUE(User[RegionAccess], User[Username], USERNAME())
    

    The fact table :

    CALCULATE(
        TRUE,
        FILTER(
            ALL(Partner),
            Partner[PartnerName] = LOOKUPVALUE(User[PartnerAccess], User[Username], USERNAME())
        ),
        FILTER(
            ALL(Region),
            Region[RegionName] = LOOKUPVALUE(User[RegionAccess], User[Username], USERNAME())
        )
    )