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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
hi_world
Helper III
Helper III

BITAND row by row on DAX

Hello, 

 

I have two tables in my direct query model : 

USER : 

 

user_mail security
tata@microsoft.com1
toto@microsoft.com0

 

 

 

FACTORY: 

 

factory_name user_mail security
Factory 1tata@microsoft.com0
Factory 1toto@microsoft.com0
Factory 2tata@microsoft.com1
Factory 2toto@microsoft.com1
   

The relationship between the two tables is on the user_mail

I need to create a role on the user table (or factory) 
The DAX  in the role seems to be something like that : 


USER[user_mail] =USERPRINCIPALNAME()
&&
BITAND(FACTORY[security],USER [security]) =FACTORY[security]



That means i need to compare for each user connecting on the dataset the row security and give him or not access to see factory row.

 

I had tryed lot of dax formula with no success. 

 

Thank you so much for your help.

best regards

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

if you stay in the user table you would have to use RELATEDTABLE.   However you can create two separate rules.

 

in the User table:

[user_mail] =USERPRINCIPALNAME()

 

in the Factory table:

BITAND([security],RELATED(USER [security])) =[security]

View solution in original post

1 REPLY 1
lbendlin
Super User
Super User

if you stay in the user table you would have to use RELATEDTABLE.   However you can create two separate rules.

 

in the User table:

[user_mail] =USERPRINCIPALNAME()

 

in the Factory table:

BITAND([security],RELATED(USER [security])) =[security]

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors