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
unnijoy
Post Partisan
Post Partisan

Dynamic RLS with Multiple Dimension Table

I have a Fact tablw which contain the sales data. And i got 2 dimension table. one for country and other for Sr manager names. Now i create a new table for access list. its is shown below.

unnijoy_0-1664776304944.png

I need to create the RLS based on the above list. As we can see that for Alex Sr Manager is showing as "All". IF "All" is coming then he should be able to see all the SR Manager name. Same in the case of Glen. For him both Country and SR Manager is coming as "All". So he should be able to see all the country and all SR manager. How can i achive this.

 

I tried something like this below. But when it is coming to "ALL" its coming as blank.

var _Restriction =
CALCULATETABLE(
VALUES( Access_List[Country] ),
Access_List[Email ] = USERPRINCIPALNAME()
)
var _RLS_Rest =
SWITCH(
TRUE(),
_Restriction = "ALL", TRUE(),
[Country] = _Restriction, TRUE(),
FALSE()
)
Return
_RLS_Rest

2 REPLIES 2
amitchandak
Super User
Super User

@unnijoy , I Usually Create a table with All , Name union with Name, Name and the join with table to get names when all use

 

All Guy

Guy Guy

 

Once UI gets the merged table, I have a column with the name, and you do not have to handle all

hi @amitchandak , i am not able to understand the solution that you gave. can we fix the below with out creating multiple tables.

 

var _Restriction =
CALCULATETABLE(
VALUES( Access_List[Country] ),
Access_List[Email ] = USERPRINCIPALNAME()
)
var _RLS_Rest =
SWITCH(
TRUE(),
_Restriction = "ALL", TRUE(),
[Country] = _Restriction, TRUE(),
FALSE()
)
Return
_RLS_Rest

 

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.