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
GAPER
Helper V
Helper V

Using table like below to create row level security

I have a mapping table like this. How do I write a formula to filter projects only show = 1 for each individual?

I was thinking using userprincipalname() but it's a measure so it' cant be used as a filter. Thanks!

 

 

EmailProjectShow
person1@abc.comProject 11
person1@abc.comProject 21
person1@abc.comProject 30
person1@abc.comProject 40
person2@abc.comProject 11
person2@abc.comProject 21
person2@abc.comProject 31
person2@abc.comProject 41

 

Clafirication: this is just an extra filter table. I have an underlying data table for example

 

Project Revenue 

 

Project 1 100

Project 2  200

1 ACCEPTED SOLUTION
v-kaiyue-msft
Community Support
Community Support

Hi @GAPER ,

Thanks @FarhanAhmed  for sharing, here are some suggestions that I hope will be helpful to you.
You can write the formula when creating the role:

[Email] == USERPRINCIPALNAME() && [Show] == 1

vkaiyuemsft_0-1711502957956.png

 

The formula uses this function to dynamically filter items based on the logged in user's email and the "show" column in the mapping table.
Roles can be tested using views as, which allows you to simulate the experience of a user assigned this role.

vkaiyuemsft_1-1711502976893.png

 

vkaiyuemsft_2-1711502976894.png

 

 

For more information about RLS, please refer to the document: Row-level security (RLS) with Power BI - Power BI | Microsoft Learn.

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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-kaiyue-msft
Community Support
Community Support

Hi @GAPER ,

Thanks @FarhanAhmed  for sharing, here are some suggestions that I hope will be helpful to you.
You can write the formula when creating the role:

[Email] == USERPRINCIPALNAME() && [Show] == 1

vkaiyuemsft_0-1711502957956.png

 

The formula uses this function to dynamically filter items based on the logged in user's email and the "show" column in the mapping table.
Roles can be tested using views as, which allows you to simulate the experience of a user assigned this role.

vkaiyuemsft_1-1711502976893.png

 

vkaiyuemsft_2-1711502976894.png

 

 

For more information about RLS, please refer to the document: Row-level security (RLS) with Power BI - Power BI | Microsoft Learn.

 

If your Current Period does not refer to this, please clarify in a follow-up reply.

 

Best Regards,

Clara Gong

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

GAPER
Helper V
Helper V

this is the extra layer of information i used to filter the table. Not the underlying table

FarhanAhmed
Community Champion
Community Champion

Why can't you filter out Show=0 from your data source or in Power Query?







Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!

Proud to be a Super User!




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.