Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
cv77
Helper I
Helper I

Filter based on username without using row level security

Hello,

 

- I have a table with a username and a geographic area, and users are allowed to see only particular geographic areas as well as report visuals which contain rolled up (aggregated) data for all areas, and more than one user may be allowed to see a particular area
- when we use powerBI's RLS the rolled up data is restricted as well, so we can't use RLS
- when users access the powerbi reports we can get their AD username and would like to restrict the data using the user table which contains this AD username and IDs of allowed geographic regions
- how can we implement this, given that we can't filter on a page using a measure? I tried putting the UPN in a measure and then creating a custom column in the usertable which contains a 1 if the UPN matches the username in the table and a 0 if it does not, but I can't reference a measure which contains Username() in a column either

 

Thanks.

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

that, or providing different apps to different audiences.

View solution in original post

8 REPLIES 8
lbendlin
Super User
Super User

that, or providing different apps to different audiences.

Thank you for your clarifications.  Providing different apps to different audiences isn't an option for us so I will look at changing how the rolled up data is stored.  

lbendlin
Super User
Super User

You're describing how RLS works. "Stop fighting the API"

So redo the data model taking the aggregated data outside the tables filtered by RLS.  That is the only solution?  

lbendlin
Super User
Super User

How would that be different from RLS? 

My thinking is to create a table which is joined to the usertable to get the allowed regions, and pass the allowed regions to the rest of the dataset without using RLS.  The main dataset is not joined to the table filterd by RLS.  Could be my thinking is wrong though.  

If anyone has ideas on how to do this would be apreciated.  

amitchandak
Super User
Super User

@cv77 , You can not refer a measure, UPN or a slicer value in a new column

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Ok, thanks for confirming that.  Appreciate the response.  

 

I am thinking to try this

- create another table with the usernames and regions, which is not joined to the rest of the dataset

- dynamicaly read the selected values from it, using something like SELECTEDVALUES()

- somehow (?) filter the main region table using those values, which in turn filters the rest of the dataset

 

I haven't tried this, this is just what I am thinking to try next as am running out of ideas.

 

 

 

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors