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.
456 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Amira Bedhiafi 25,866 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())
        )
    )
    

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.