Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
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]
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
82 | |
78 | |
52 | |
39 | |
35 |
User | Count |
---|---|
94 | |
79 | |
51 | |
47 | |
47 |