当前位置:网站首页>Bi skills - authority control
Bi skills - authority control
2022-06-23 03:10:00 【Powerbi white tea】
BI Visualization in the implementation process , What are the most concerned points of users ?
I believe many of my friends have encountered this problem , Or asked by others , White tea summarizes some points that users care about : Security 、 Self help 、 Authority control 、 Ease of use 、 Compatibility 、 Extensibility 、 convenience 、 Reaction speed, etc .
What about this issue , Let's talk about permission control .
PowerBI So far , The permission control that can be realized includes three aspects : Page permissions 、 Line authority 、 Column permissions .
So these three are PowerBI How is China realized ? Don't worry. , Follow the idea of white tea .
Let's take a look at the case data in this issue :
The case data is not very complex , There are three tables in total , They are the permission table 、 Country tables and case data .
Import it into PowerBI in , Let's simply handle the permission table .
This is PowerQuery Screenshot of permission table in , You can see that page permissions and country permissions are stored in a comma separated manner .
We need to split these two columns .
choice “ Page permissions ”, choice “ Split column ”, Select press “ Separator split ”.
choice “ Custom delimiter ”, Enter the space between text , Choose advanced options , Select split into “ That's ok ”.
give the result as follows :
Empathy , According to the above operation , We will “ Line authority ” To break up .
The advantage of doing so is , After the report is officially put into use , Users only need to maintain Excel Permission configuration in file ,PowerBI Will automatically split in the background , Perform report permission control .
Select close and apply , The model is shown in the following figure. .
Notice here , Permission tables do not need to establish model relationships with other tables .
White tea according to case data , I simply made the following statements .
home page : Used as page permission control , The use field is the page permission field in the permission table .
Visualization page : Used to display column permissions .
Details page and map page : Show page permission and row permission usage .
Come here , Our preparations have been basically completed , Let's take a look , Three in PowerBI How to implement in .
Page permissions :
1. Report page naming and hiding .
Here we need to pay attention to , Name of the report page , Be sure to make contact with Excel The text in corresponds to , Otherwise, the navigation will fail .
When we're done configuring , Pages other than the home page , All should be set to hide ; When publishing, the page should stay on the home page .
2. Page permission configuration : choice “ Management roles ”, Choose to create a role “ Page permissions ”, stay “ Permissions on the table ” Enter the following code .
[ mailbox ]=USERNAME()
3. Page setup : The slicer field selects... In the permission table “ Page permissions ” Field .
Add the following measures :
Page selection = SELECTEDVALUE ( ' Permissions on the table '[ Page permissions ] )
Add a button , stay “ operation ” The type selected in the setting is “ Page navigation ”, Click on “fx” Button , The selected field value is “ Page selection ”.
Come here , Page permission configuration is complete , Let's click... On the panel “ View as ”.
For other users, we can enter the user's email to test .
We type in BB Test it :
You can see , When we type in BB In the mailbox , The slicer will automatically filter the page according to the user's permission .
Line authority (RLS):
Row permissions often represent the data range that users can see .
1. Add the following measures :
State authority = VAR CountryAccess = CALCULATETABLE ( VALUES ( ' Permissions on the table '[ Line authority ] ), ' Permissions on the table '[ mailbox ] = USERNAME () ) RETURN SELECTEDVALUE ( ' Country table '[CountryZH] ) IN CountryAccess
2. Add a new role in the management role page as follows .
The code is as follows :
[ State authority ]=True()
So we can see the data range , It will be filtered according to the user's permissions .
Let's have a simple view on the report page .
Column permissions (OLS):
Column permission control , It usually means that the user can see different columns .
stay PowerBI in , There are two ways to do it :A.Tabular Editor The way .B.DAX The way .
These two ways ,A In fact, white tea is not recommended for everyone to use .
for instance :Tabular Editor You can control whether a physical column is displayed according to user permissions , So this column , In the process of making reports , You need to use it with caution , Once used , When some users without permission open the report , Some visual charts on the report page will report errors , This is for the user experience , Very bad .
B The way , White tea is recommended for you , Write column permissions into DAX in , It's more flexible .
Simulation scenario :
If the user is “ management layer ”, The chart shows “Budget” data , If the user is “ Executive ”, The chart shows “Amount” data .
Write as follows DAX:
Column permissions = VAR RoleAccess = CALCULATETABLE ( VALUES ( ' Permissions on the table '[ role ] ), ' Permissions on the table '[ mailbox ] = USERNAME () ) RETURN IF ( RoleAccess = " management layer ", SUM ( ' Case data '[Budget] ), SUM ( ' Case data '[Amount] ) )
Put it into the visualization , Let's take a look at the effect .
DAX How to control column permissions , The best practice is to work with SSAS Use it with , This can be done in Tabular Hide columns , Present only DAX To the user , Achieve real OLS Control and control .
matters needing attention :
1. Permission control can be deployed locally and in the cloud Servers Use , The free version of this machine can only be viewed through roles .
2. On the cloud Servers The minimum license for use needs to be Pro account number .
3. On the cloud Servers You need to add the shared user to the corresponding workspace , Permission is “ viewer ”. And need to be in the same organization .
4. Data set security needs to be set , Add the user mailbox to the role .
( White tea : Documents on the planet of knowledge )
This is white tea , One PowerBI Beginners .
边栏推荐
- Wwdc21 - App store server API practice summary
- Add other view components to the audio and video components of the applet
- Transformation solution of digital intelligent supply chain platform for project management in engineering industry
- January 31, 2022: Maze III. There is a ball in the maze of open spaces and walls. ball
- Goframe framework (RK boot): fast implementation of server-side JWT verification
- Related concepts of TTF, TOF, woff and woff2
- Blue screen and abnormal downtime DMP file and system log collection
- Daily shift series: memory problem of primary online service
- Optimization method of live weak network
- 2022-02-05: the k-th decimal number of dictionary order. Given integers n and K, find 1
猜你喜欢

How to store, manage and view family photos in an orderly manner?

Soft exam information system project manager_ Contract Law_ Copyright_ Implementation Regulations - Senior Information System Project Manager of soft exam 030

Soft exam information system project manager_ Information system comprehensive testing and management - Senior Information System Project Manager of soft test 027

8. greed

Vulnhub DC-5
随机推荐
The performance of the new Tokio scheduler is improved by 10 times
Deep analysis of time complexity
Learning record -- memo on constructors and attributes in C
Goframe framework (RK boot): fast implementation of server-side JWT verification
Wi Fi 6 is coming - larger capacity, lower latency, faster network speed and more security
Goframe framework (RK boot): Based on cloud native environment, distinguish configuration files (config)
Why can only a small number of condition type prices be maintained in me12 of SAP mm?
Tachometer script
Communication between containers flannel and calico comparison
Integrate Tencent maps with micro build and low code
Transformation solution of digital intelligent supply chain platform for project management in engineering industry
Optimization method of live weak network
[SaaS examination certification] apaas_ Tencent Qianfan magic pen
January 31, 2022: Maze III. There is a ball in the maze of open spaces and walls. ball
Golang string comparison
Quickly grab the red envelope cover of Tencent blue whale New Year! Slow hands!
How to gracefully solve the problem of platform font adaptation
How to make keyword targeted layout based on search sources?
Great WPF open source control library newbeecoder UI
The difference between code39 and code93