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! Learn more

Reply
DesNaidoo
Frequent Visitor

Need help with DAX RLS filter

Hey Guys,

 

Hope someone can help. I know I sound like a noob...but, I would like to filter one table with values from another table. I am setting up RLS that filters the tables based on the current user (Power BI Embedded into an app)

 

I have two tables Groups and UserHasGroups

Groups

IDGROUP_NAME

 

UserHasGroups

USER_IDGROUP_ID

 

UserHasGroups[GROUP_ID] = Groups[ID].

In the Roles, I have a DAX filter that filters the UserHasGroups to only display the groups for the current user:

 

 [USER_ID]=
            LOOKUPVALUE(
                USER[ID],
                USER[USERNAME],
                USERNAME()
            )
 

 

 What I would like to accomplish is to thereafter filter the Groups table to only include IDs that exists in the filtered UserHasGroups table. 

 

can anyone please help me with this?

 

Thanks.

4 REPLIES 4
lbendlin
Super User
Super User

1. please do not use USERNAME(), it behaves differently on the desktop and in the service. Use USERPRINCIPALNAME()

2. Normally this type of RLS is implemented through the data model (ie the UserHasGroups table sits upstream from the Groups table and filters it automatically).  Is that something you can consider?

Thanks @lbendlin for your reply
I will consider using the USERPRINCIPALNAME().
The problem is, I have bridge tables and UserHasGroups is sitting on the many side of the relationship. 

That is indeed a problem. What's the reason for that setup?

Its sure is. Quite a complex design that had to accomodate for method of provisioning entities in our App.

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.