Security in Power BI
Data Security is the most important aspect when we share the data with others, they could be external clients or internal stakeholders. Often times we don’t want to share all the data with everybody. For example when we are sharing the file with regional managers what is the point of sharing other region’s sales data to the “South zone manager. So with this regard, we can create security access in Power BI while sharing the reportPower BI While Sharing The ReportThe share button is the most basic way to share a report. Other options include using the workspace, publishing the report to the web, embedding it in Share Point, and secure embedding..
In this article, we will take you through the process of building row-level security access in Power BI.
Row Level Security
Data is stored in rows and columnsRows And ColumnsA cell is the intersection of rows and columns. Rows and columns make the software that is called excel. The area of excel worksheet is divided into rows and columns and at any point in time, if we want to refer a particular location of this area, we need to refer a cell., so when we want to share the data with a larger group all of them don’t want to see all the rows of data. So we can create “row-level security” in power bi to enable the specific person to see an only specific set of data.
For example, a sales manager of “India” has to see only the data of “India” region sales numbers, and the overall business head can see all the region’s data. So this is the kind of security that we need to create before sharing the data, and this is called “Row Level Security.”
Create Row Level Security in Power BI
To create row-level security, we need to have some sort of data, and we have already created a simple chart in Power BI.Chart In Power BI.There are many types of visualization techniques in POWER BI, and the most important and extensively used is a chart, which is used in every report or dashboard to display data. There are inbuilt charts in POWER BI to use, with an option to make combo charts or custom made charts.
You can download the workbook to use the same file as we used in this example.
Below is the chart created in Power BI to show the product-wise sales chart.
At this moment, we have overall all the countries’ sales based on different products. Now we need to create row-level security to show only specific country sales based on products, and below are the countries we have on this list.
Canada, France, Germany, Mexico, and the United States of America.
Follow the below steps.
- Under the MODELLING tab, click on “Manage Roles.”
- This will open up the “Manage Roles” window like the below one.
- Click on the “Create” option to create the first country role.
- Give a name to this role. Since we are creating first country security, give the names as “Canada.”
- Next, we have the table name as “Data Table” click on the ellipsis (three dots) it will show the “Add Filters” option.
- Hover on “Add Filter” it will open up all the columns in the table. Since we are applying country-wise row-level security, choose the option of the “Country” column.
- Using the “DAX” expression, we need to create a role here. Enter the country name in double-quotes. Click on “Save” to close the “Manage Roles” window.
- Now, we have created row-level security for the country “Canada.”
Under the MODELING tab next to the option of “Manage Roles,” we have an option called “View as Roles” click on this.
This will open up the roles list that we have created.
- Choose the role “Canada” and click on “Ok.”
- Now we can see only the “Canada” country sales chart only.
As you can see at the top of the chart, it shows “now viewing the report as Canada” to go back to the older chart, we can click on the “Stop Viewing” option.
Like this creates roles for other countries as well.
Now in Power BI services, we need to assign the email id’s to share the report.
Configure Power BI Services
- Publish the report to Power BI Services by clicking on the “Publish” option in Power BI Desktop.
- Now log in to the Power BI Services account in the Power BI services account, it will be published in My Workspace.
- Click on three dots in front of the published article under Dataset.
- Choose the “Security” option.
- It will show a row-level security option for you. Enter the email address of the respective sales manager here and click on the “Add” option.
Now save it. Like this, we can create row-level security in Power BI.
Note: Power BI dashboard file can also be downloaded from the link below, and the final output can be viewed.
Things to Remember
- Once the Row Level Security is created in Desktop, you need to publish the report to Power BI Services, and you need to have a paid version to share the report with the concerned person.
- Only filtered data can be viewed from the concerned person.
This has been a guide to Power BI Security. Here we discuss how to build row-level security access while sharing power bi reports using an example. You can learn more from the following articles –