Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Third and last time I try to get an answer for this, I'm starting to think this is not even a thing!
I have applied row-level security for individual employees for a report by having a rule of Username = username() in my Dataset.
The username column resembles what PowerBI recognises as =username() which is my employee ID and a company prefix.
I then publish the dataset to power bi online and created a report which points to the dataset.
When I view the report on power bi online, everything is blank. So the RLS has worked too well, and is not even showing me my data.
I tried entering my email address into the security group on power bi online for the dataset, but this has no effect.
Am I missing a step somewhere?
I believe the issue arises when you upload your report to the service - at least if the Username is something like companyABC\User123.
The below link and quote describes the issue.
"Within the Power BI service, username() and userprincipalname() will both return the user's User Principal Name (UPN). This looks similar to an email address."
https://docs.microsoft.com/en-us/power-bi/service-admin-rls
You can try to troubleshoot it by making a USERNAME() measure just to see what the username should be equal to in your model.
If the above works then please mark it as the solution, kudos is also appreciated.
@Anonymous
Yep I created a measure, then created a column that resembles that measure.
In the Modeling section when I add the rule Username = Username() <<< should it be Username = "Username()" ??? with the quotes or without?
It should be without quotes.
You should have something like this in the "Manage Roles" pop-up.
Is the security/Email in your facttable or do you have a seperate table with you emails which has a relation to the table?
@Anonymous
So the dataset has a few tables, some of which hold the username and some of which don't, and i've created joins/merges in Query Editor to get a single table which holds everything I need. All the tables come from the same SQL server though.
The relationship is two way between the source table and the new table. I tried having the report visualisations in the dataset and seeing if that works, but it doesn't. If I 'test as role' I see no data at all, whether I add my email address to the role or not.
But I open the published Power BI Report I can see all of the data. I guess that's because I published it so it's ignoring the restrictions for me.
I have no idea what i'm doing wrong.
User | Count |
---|---|
101 | |
90 | |
78 | |
70 | |
69 |
User | Count |
---|---|
110 | |
96 | |
95 | |
74 | |
71 |