Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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 @Anonymous
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]
)
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
71 | |
70 | |
38 | |
26 | |
26 |
User | Count |
---|---|
100 | |
87 | |
45 | |
43 | |
35 |