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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Filter out rows based on loged in user

Hi,

I struggle with an issue and did not find a solution until now. Maybe someone could help me.

 

There is a dimension table: DimPlaces

DimPlaces hold mainly cities like London, Berlin, Rome, Madrid, Boston etc.

 

Now different uses can use my report and the log in via the cloud. Which uses accesses the report is easy to find out. I implemented a measure CurrentUser := USERNAME()

 

Then I want to filter out some rows from DimPlaces based on the current user.

For this I had an additional table UserPlaces like:

Mike – London
Mike – Madrid
Pedro – Rome
Herbert – Berlin
Herbert – Rome

 

My measure tells me which use is active, I can find out the cities for this user but how to filter out the entries in DimPlaces that the user should not see?

 

Any advices?

Best regards

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

Hi @Anonymous 

So what you're trying to achieve is called RLS (short for Row-level Security). Fortunately, you have everything you need to implement RLS, so do the following:

Create a relationship between your two tables DimPlaces and UserPlaces with City as the connection column. 
Then go to Modeling -> Manage Roles and create a new role for your UserPlaces tables. Here you can create a simple DAX saying something like Name = USERNAME()

This will filter your UserPlaces table, which will then filter your DimPlaces due to the relationship between them. 

Hope this helps!

View solution in original post

v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please refer to the online document about setting RLS.

https://docs.microsoft.com/en-us/power-bi/desktop-rls 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

3 REPLIES 3
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

Please refer to the online document about setting RLS.

https://docs.microsoft.com/en-us/power-bi/desktop-rls 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

Hi @Anonymous 

So what you're trying to achieve is called RLS (short for Row-level Security). Fortunately, you have everything you need to implement RLS, so do the following:

Create a relationship between your two tables DimPlaces and UserPlaces with City as the connection column. 
Then go to Modeling -> Manage Roles and create a new role for your UserPlaces tables. Here you can create a simple DAX saying something like Name = USERNAME()

This will filter your UserPlaces table, which will then filter your DimPlaces due to the relationship between them. 

Hope this helps!

Anonymous
Not applicable

Yes, that's a solution.

 

The only issue here (well, not really an issue ...) is, that security is not a concern in this project. It is just a question about usability - there are many places and a user should not see places (for selection) that he does not need.

Thanks to you I can realize this via security.

 

Regards,

jomu

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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 Solution Authors