Forum Discussion

Negi's avatar
Negi
Helper I
11 months ago
Solved

Row level Security multiple columns Dynamic

Hi All,   I have 1 fact Table which contains approx 100 million rows of data. sample data as below.   After this I have created multiple tables which contains useremail id based on there user acce...
  • rohit1991's avatar
    11 months ago

    Hi Negi 

     

    You can secure this scenario by building a mapping/security table where each row links a user to their allowed Region, Country, and City. Relating this table to your fact data makes RLS much easier to manage. Then, apply a single filter in your RLS role like:

    [UserEmail] = USERPRINCIPALNAME()
    

    This ensures that each user only sees the rows matching their mapped access. A few points to keep in mind:

    • This approach avoids hardcoding filters for every column.

    • It’s easy to extend when new users, regions, or cities are added — just update the mapping table.

    • Use composite keys if you need to control access across multiple levels (e.g., Region + Country).

    • You can manage the mapping table in OneLake or SQL so that admins update permissions without editing the RLS role.

    • Test with different sample users to confirm that filtering cascades properly through all columns.

     

  • Negi's avatar
    Negi
    11 months ago

    Hi rohit1991 ,

    This function I can use in RLS role. but I am not able to understand , If I create a single table. for example it contains ID column and user email id where each row contains email id. than how I will make a relation which with new Mapping table with financial table since financial table will contains those information in multiple columns and in new mapping sheet it will contains those respective id in single column name id ?

     

    if it's possible with any dynamic dax then pls share once.  ?

     

  • rohit1991's avatar
    rohit1991
    11 months ago

    Hi Negi 

     

    This can be solved by creating a single mapping table with columns like UserEmail, RegionID, CountryID, and CityID, where each user can have multiple rows if they need access to more than one level (for example Region + City). Connect this mapping table to your fact table and set the RLS rule as [UserEmail] = USERPRINCIPALNAME(). This way Power BI will automatically filter the data based on the mapping, and each user will only see the rows linked to their entries without needing separate RLS rules for every column.