Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hello all,
Please see the below data. When i publish the below view in the service if i login with "harsha@ab.com" i dont want to see 1st record and If an user login with "gururaj@ab.com" we dont need 2nd record.
| Name | Scores | |
| Harsha | harsha@ab.com | 1 |
| Gururaj | gururaj@ab.com | 2 |
| King | king@ab.com | 3 |
I tried creating a column as
If(email=USERPRINCIPALNAME(),1,0)
But since i connected my dashboard as directquery i get an error.
Please help me to filter out the data.
Solved! Go to Solution.
You can create an RLS role with the rule
[email] <> USERPRINCIPALNAME()
Once you have created a role, anyone you want to view the report must be assigned to a role. This is the intended functionality and there isn't a way to avoid assigning roles if you want to use RLS.
See the documentation and prior discussion here:
https://community.powerbi.com/t5/Desktop/Row-Level-Security-All-Users/m-p/253154
HI @harshagraj,
You can refer to the following link to know how to set a dynamic RLS based on username:
Solved: RLS with UserName() - Microsoft Power BI Community
Notice: please create a measure with USERNAME and USERPRINCIPALNAME functions to confirm which one is suitable for your user table information.
Difference between USERNAME() and USERPRINCIPALNAME() in Power BI Dax - SPGuides
Regards,
Xiaoxin Sheng
You can create an RLS role with the rule
[email] <> USERPRINCIPALNAME()
Once you have created a role, anyone you want to view the report must be assigned to a role. This is the intended functionality and there isn't a way to avoid assigning roles if you want to use RLS.
See the documentation and prior discussion here:
https://community.powerbi.com/t5/Desktop/Row-Level-Security-All-Users/m-p/253154
@harshagraj , You can use USERPRINCIPALNAME only in a measure. I doubt you can use that in a column
Hello can someone help on this topic
@Greg_Deckler @AlexisOlson @PhilipTreacy @v-zhangti
Also if i have to create a measure then how do i aggregate Name column?
If(???(Name)=USERPRINCIPALNAME(),1,0)
Kindly help.
Thanks for the reply but how do i solve this problem?
I also tried creating a role like NAME<>LOOKUP(NAME,EMAIL,USERPRINCIPALNAME())
This is also not working properly because i dont have a speicific AD gropu to assign.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
| User | Count |
|---|---|
| 85 | |
| 42 | |
| 30 | |
| 27 | |
| 26 |