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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Pbi07
Helper V
Helper V

Dynamic Filter in the RLS

Needed some help with this RLS filtering 

 

My table has the user emails along with Divisions that each user can view the data 

 

LocationemailDivision 1Division 2 Division 3Division 4
EASTGroup1@abc.comABC DivXYZ Div123 Div 
EASTGroup2@abc.comABC DivXYZ Div123 DivNEW Div
SOUTHGroup3@abc.com777 Div555 Div  

 

I unpivoted the above to make it easier. 

 

The Fact has data of GI's for divisions . Group1@abc.com should see only the qty of 50 for 3rd Oct. How can i filter in RLS for all various divisions based on email.

 

GI NoDateQtyDivision
10001-Oct-2125XYZ Div
10013-Oct-2130ABC Div
10023-Oct-2120ABC Div
100315-Oct-2170555 Div
100415-Oct-2150123 Div
100520-Oct-21100NEW Div

 

How can i apply the RLS to handle this dynamically?  the pbix file is 

https://drive.google.com/file/d/1LKEIZmqAghp-El47AB_r0uWo0nWEbuCp/view?usp=sharing

 

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

Hi @Pbi07 ,

 

Here is an article on how to use Dynamic RLS with detailed steps, please check if it will help you with your problem:

what-do-you-need-to-implement-dynamic-row-level-security-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-xiaoyan-msft
Community Support
Community Support

Hi @Pbi07 ,

 

Here is an article on how to use Dynamic RLS with detailed steps, please check if it will help you with your problem:

what-do-you-need-to-implement-dynamic-row-level-security-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.

amitchandak
Super User
Super User

@Pbi07 , Unpivot all these four columns

Division 1 Division 2  Division 3 Division 4

 

https://radacad.com/pivot-and-unpivot-with-power-bi

Rename attribute as Divisio

 

Join Division of table 1 with division of table2 (Filter direction - Bidirectional or From Table 1 to Table2)

 

Create RLS role and filter Table1 based on user principal name 

 

refer, if needed

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

Thanks @amitchandak . 

 

The issue is the Access Grp after unpivoting will have the below effect. This prevents from doing any joins on Division Name

Pbi07_0-1638977304312.png

Pbix -  https://drive.google.com/file/d/1LKEIZmqAghp-El47AB_r0uWo0nWEbuCp/view?usp=sharing

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.