cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
freak
New Member

Filter Expression Role Level Security

Hello

 

I have a table like this

 

CompanyprincipalNameData
company1user1 ..
company1user2 ..
company2user3 ..
company2user4 ..

 

Wenn a User (user1 and 2) from Company1 open the report he should see all data from company1. 

User (user3 and 4) from company2 will only see Data from company2

 

principalName is USERPRINCIPALNAME()

 

How can i write a Filter Dax Expression?

 

Thanks

1 ACCEPTED SOLUTION
v-caitlyn-mstf
Community Support
Community Support

Hi @freak ,

 

It sounds like you need an RLS setup with hierarchy.
You could try using Dynamic Row Level Security with Manager Level Access in Power BI.

 

The very first step is always identifying who is the person logged into the report in Power BI Service. This can be done with Username() or UserPrincipalName() functions in DAX.

We can use a DAX expression to identify is the person logged in, a manager or not. This can be done with a simple MAXX expression.

 

For more information,you can refer to:Dynamic Row Level Security with Manager Level Access in Power BI 

 

Hope it helps,


Community Support Team _ Caitlyn

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-caitlyn-mstf
Community Support
Community Support

Hi @freak ,

 

It sounds like you need an RLS setup with hierarchy.
You could try using Dynamic Row Level Security with Manager Level Access in Power BI.

 

The very first step is always identifying who is the person logged into the report in Power BI Service. This can be done with Username() or UserPrincipalName() functions in DAX.

We can use a DAX expression to identify is the person logged in, a manager or not. This can be done with a simple MAXX expression.

 

For more information,you can refer to:Dynamic Row Level Security with Manager Level Access in Power BI 

 

Hope it helps,


Community Support Team _ Caitlyn

If this post helps then please consider Accept it as the solution to help the other members find it more quickly.

freak
New Member

Yes this works, but i want more 🙂

 

When i use [principalName] = USERPRINCIPALNAME(), user1 see only data from user1. user1 should see data from company1, as well from user2 but not from user3 and 4

 

amitchandak
Super User
Super User

@freak , In role you can add filter

 

[principalName] = USERPRINCIPALNAME()

 

Is this expression not working ?

 

How to use Row Level Security (RLS): https://youtu.be/NfdIA0uS6Nk

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Dev Camp Session 22 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!