{"id":10427,"date":"2020-10-07T14:30:01","date_gmt":"2020-10-07T19:30:01","guid":{"rendered":"https:\/\/threecloud.wpengine.com\/post\/testing-row-level-security-in-the-power-bi-service-2\/"},"modified":"2023-10-09T14:04:33","modified_gmt":"2023-10-09T21:04:33","slug":"testing-row-level-security-in-the-power-bi-service","status":"publish","type":"post","link":"https:\/\/3cloudsolutions.com\/resources\/testing-row-level-security-in-the-power-bi-service\/","title":{"rendered":"Testing Row-Level Security in the Power BI Service"},"content":{"rendered":"<p style=\"font-size: 18px;\">In my last post, I showed how to test row-level security in Power BI Desktop.\u00a0In this follow up, you\u2019ll learn how to test row-level security in the Power BI Service once you\u2019ve published your file there. Also, please check out my demo at the end of this post.<\/p>\n<ul style=\"font-size: 18px;\">\n<li>After navigating to the workspace where I published my file, I need to find the data set and select Security from the option menu, as row-level security resides at the data set level.<\/li>\n<li>On the next screen, you should see the role that was created in Power BI Desktop, along with a field to enter your role membership, in other words, people or groups who belong to this role.<\/li>\n<li>You will see the functionality to test row-level security only when you hover the mouse over the role and get the ellipsis. Click on this ellipsis and you\u2019ll get the option that says, \u2018test as role\u2019.<\/li>\n<li>This will take us to the report page where it appears that row-level security is immediately applied. I know this because I see that Power BI is taking my login credentials and applying it to the report which matches what I saw when I was testing this in Power BI Desktop.<\/li>\n<li>If I want to change the user that I\u2019m testing, I can enter a new email by clicking on the menu at the top.<\/li>\n<li>One important thing to clarify:\n<ul>\n<li>Once a PBI file is published to the service, there are other considerations that can impact if row-level security works as expected, such as workspace membership roles, data set permissions and data set security role memberships.<\/li>\n<li>For example, if we look at our workspace membership, we see that we have 3 report users with 3 different roles. Row-level security only applies to users in a viewer role, not to members, admins, or contributors.<\/li>\n<li>In my example, I am admin of the report, so if I return to the report page and type in my email, I have access everything and the actual result is returned. This also applies to contributors and if I type in their email, they will get the same result with access to all the data, just as I did as an admin.<\/li>\n<li>If I type in the email of a viewer, I expect to see his information filtered on the page, but instead a get a bunch of errors. This is because row-level security applies to viewers since they do not have a role membership, so Power BI won\u2019t let them see the data.<\/li>\n<li>To give a viewer access, you\u2019ll need to go back to the row-level security page and with the role selected, we can enter the viewer\u2019s email in the Members field, then click add and save.<\/li>\n<li>A best practice here is to only use security groups when you\u2019re creating role membership; it\u2019s easier than explicitly entering names and is much easier to maintain.<\/li>\n<li>To test if this worked, I simply click on test this role, go back to my report page and enter the name of the viewer whom I just added, and the page should filter to what the view can now see.<\/li>\n<\/ul>\n<\/li>\n<li>What happens when role testing doesn\u2019t work correctly? Check out my graphic below which gives 3 examples of errors returned and the reasons why role testing may not work.<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p style=\"font-size: 18px;\">I hope this post on testing row-level security in the Power BI Service was helpful. If you have questions or want to know more about row-level security in Power BI, about Power BI in general or any Azure product or service, let us know \u2013 our team of experts are here to help.<\/p>\n<p><iframe loading=\"lazy\" src=\"https:\/\/www.youtube.com\/embed\/qsJwKSKbwnc\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><br \/>\nNeed further help? Our expert team and solution offerings can help your business with any Azure product or service, including Managed Services offerings. Contact us at 888-8AZURE or\u00a0 <a href=\"mailto:sales@3cloudsolutions.com\">sales@3cloudsolutions.com<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In my last post, I showed how to test row-level security in Power BI Desktop.\u00a0In&mldr;<\/p>\n","protected":false},"author":31,"featured_media":10826,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"content-type":"","footnotes":""},"categories":[260],"tags":[234],"class_list":["post-10427","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-data-ai","tag-azure-every-daypower-bipower-bi-servicerow-level-security","topics-blog"],"acf":[],"_links":{"self":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/10427","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/users\/31"}],"replies":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/comments?post=10427"}],"version-history":[{"count":0,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/posts\/10427\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media\/10826"}],"wp:attachment":[{"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/media?parent=10427"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/categories?post=10427"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/3cloudsolutions.com\/wp-json\/wp\/v2\/tags?post=10427"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}