cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Pbi07
Helper IV
Helper IV

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-caitlyn-mstf
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-caitlyn-mstf
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



Power BI Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!
Want To Learn Power BI | Beginners !! Advance Concepts !! Power BI For Tableau User !!

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
August 2022 update 768x460.jpg

Check it Out!

Click here to learn more about the August 2022 updates!

August 1 episode 9_no_dates 768x460.jpg

The Power BI Community Show

Watch the playback when Priya Sathy and Charles Webb discuss Datamarts! Kelly also shares Power BI Community updates.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Top Solution Authors
Top Kudoed Authors