Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
I have created a report based on an entity in the Common Data Service. One of the fields in my entity is called username. I want to be able to filter the data so users who view the report will only see their own data. Is this possible? If so, how?
I tried using Row Level Security to implement this, but it did not work.
it is possible by using Row Level Security, you need to add an additional column listing the email address with which they will log into Power BI service and then use the function USERPRINCIPALNAME
http://radacad.com/dynamic-row-level-security-with-power-bi-made-simple
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
Thank you for your reply. Is it possible to use USERNAME() rather than USERPRINCIPALNAME()? In the article, it mentions that it is possible. I tried creating a user security role with the following DAX expression: [Username] = USERNAME()
This did not work.
I do not have a column in my entity for email addresses, so USERPRINCIPALNAME will not work for me.
https://www.youtube.com/watch?time_continue=5&v=qrlq9sZyjug
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
I watched the video but it still does not answer my question. I'm aware I can create roles where [field] = "Text". However, I want to be able to create a role based on who is logged in. An expression like [Username] = USERNAME() doesn't seem to work. Is there something wrong with my formula?
You need to add an additional column to your table containing the email address they will use to log into Power BI service, that is what is recognized in the service. USERNAME and USERPRINCIPALNAME both return the email address of the user when used in the Service
Did I answer your question correctly? Mark my answer as a solution!
Proud to be a Datanaut!
I added a field called cr265_useremail and populated it with users' email addresses. I then created a security role with the DAX expression: [cr265_useremail] = USERPRINCIPALNAME()
I then clicked "View as roles". This did not work. I also tried [cr265_useremail] = USERNAME().
Am I missing something?
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
114 | |
94 | |
90 | |
35 | |
35 |
User | Count |
---|---|
153 | |
99 | |
82 | |
63 | |
54 |