Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Anony_mous
Frequent Visitor

Access restrict based on userlogged in

Hello Team,

I am new to power bi I got a requirement like I need to restrict the access based on organizational heirarchy. let's say I have a card visual in that I am showing the total trainings completed.If a user clicks on that card it will take a user to a backend table where it will show the total number of trainings completed for his or her  based on  organizational role.if a specific user Email is not existing in ManagerEmail column it is not showing we can't add email because it is a organization heirarchy .As of now I am selecting the backend table and applying the filter on this visual by passing a measure and giving value greater than 0 since I am writing the DAX like this:

test =
VAR A= USERPRINCIPALNAME()
return
IF(A<> "xyz@gmail.com",
    COUNTROWS(FILTER('Table1','Table1'[ManagerEmail]=A ||'Table1'[L3] = A || 'Table1'[L2] = A ||'Table1'[L1] = A)),1)
 
Assume xyz@gmail.com is the developer email he has to see the complete dashboard Other than developers few users need to see the  complete dashboard as well As of now it is working fine if we give only 1 email in the dax that is xyz@gmail.com but can't add more email. how to alter the DAX I wrote or Is there a possible way around.Please give some solutions all suggestions are welcome thank you in advance!!
Regards,
Anony_mous
1 REPLY 1
brokencornets
Helper III
Helper III

Hello

 

It sounds like you need to look into using Row-Level Security (RLS).

 

In Power BI Desktop, go to Modeling > Manage Roles and press Create. From there, you can add filters to the data tables you want to restrict by clicking on the ellipsis next to the table name and adding a DAX experssion. For example, you might use a DAX expression like [ManagerEmail] = UserPrincipalName() 

 

You can test by clicking Modeling > View As and typing in an email address.

 

Once you've created the role, you do then need to assign people to the roles in the Power BI Service (click on the ellipsis next to the data set and select Security)

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.