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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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