Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I'm trying to implement a row level security using the below code but it doesn't work as intended.
However, when I replaced USERPRINCIPALNAME() with the actual email address, the RLS filter works. Is there something wrong with my DAX expression which does not allow USERPRINCPALNAME() to work?
Below is the email mapping table. This is a standalone master data and will have a one to many relationship to the main table which requires row level security filtering as per the USERPRINCIPALNAME()
Solved! Go to Solution.
Try this DAX
[dept] = MAXX(
FILTER(
email_mapping,
CONTAINSSTRINGEXACT(TRIM(email_mapping[Permissions]), TRIM(USERPRINCIPALNAME()))
),
email_mapping[Dept]
)
Hi @wow921
If the Department column has a relationship with the Fact Table Department, then try this.
CONTAINSSTRING(email_mapping[Permissions], USERPRINCIPALNAME())
Joe
Proud to be a Super User! | |
Date tables help! Learn more
Thanks for the reply. Yes the Department column has a relationship with the Fact Table Department. The DAX Expression you have provided seems no different to mine?
It is that in that there is no need to define the Department if you have a relationship between both tables.
I am presuming that you are using the Modeling > Manage Roles feature?
Proud to be a Super User! | |
Date tables help! Learn more
Try this DAX
[dept] = MAXX(
FILTER(
email_mapping,
CONTAINSSTRINGEXACT(TRIM(email_mapping[Permissions]), TRIM(USERPRINCIPALNAME()))
),
email_mapping[Dept]
)
User | Count |
---|---|
116 | |
73 | |
62 | |
50 | |
46 |
User | Count |
---|---|
173 | |
123 | |
60 | |
59 | |
57 |