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.
Has anyone managed to achieve this using USERNAME() and RLS (Row Level Security).
I've been trying for a number of hours now and it just doesn't seem to work.
Solved! Go to Solution.
Hi @PowerBI001 ,
RLS wouldn't work on the owner of the dataset. Because the owner can edit both the dataset and reports. RLS aims at controlling the data access rather than something like filtering. You can run "Test as role" to see the effect.
According to my test, RLS works as expected.
Best Regards!
Dale
Did you notice that it would work if you share the report with others? Maybe you are the owner of the dataset. But I will find out more details tomorrow. I have tested it. You can test it with sharing with colleagues.
Regards,
Classboat
This is exactly what I've done.
Created a dataset with 2 records in Power BI desktop directly:
This is the DAX statement I’ve got setup
And configured Security for the dataset, add me and another user
But when I view the data in www.app.powerbi.com I see both records. I should see the 1 record corresponding to my email address.
If I test using ‘Test as role’ it works as I expect and shows just my record.
Hi @PowerBI001,
Did you notice that it would work if you share the report with others? Maybe you are the owner of the dataset. But I will find out more details tomorrow. I have tested it. You can test it with sharing with colleagues.
Best Regards!
Dale
Hi, @v-jiascu-msft,
I have no other users to share it with currently, I'm trialling whether this works, and then I will buy a subscription.
Could you test whether the owner of the dataset is unable to view the data with RLS applied?
Thanks
Hi @PowerBI001 ,
RLS wouldn't work on the owner of the dataset. Because the owner can edit both the dataset and reports. RLS aims at controlling the data access rather than something like filtering. You can run "Test as role" to see the effect.
According to my test, RLS works as expected.
Best Regards!
Dale
Hi @PowerBI001,
Did you get any error messages? Could you please post some snapshots?
I did it following the steps below. It worked.
1. Create reports and RLS roles in the Desktop. (RLS roles only can be created in the Desktop)
if(userprincipalname()="xxxx@xxx.com",[id] = "A")
2. Publish the report to the Service.
3. Click the ellipses, Security, assign the role to users. Or test the role.
Best Regards!
Dale
Use RLS is easy
Identify the Row to filter based on the data
[EmpID] = "Value" && [EmpID] = "Value"
[EmpID] = "123" && [EmpName] = "ABC"
& Cross check in View as Roles.
Upload the file in service & assign the User or Group
Regards,
Chetan K
Has anyone managed to achieve this using USERNAME() and RLS (Row Level Security).
I've been trying for a number of hours now and it just doesn't seem to work.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
85 | |
66 | |
52 | |
47 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |