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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
DataSaurus
Frequent Visitor

Dynamic RLS pulling rules from one table to apply to another

Hi All,

 

We need to filter based off of domains but the domains list needs to be able to update dynamically, showing content only for the domain the user is accessing the Power BI report from. 

 

There are three relevant tables, LocationDomainList and a table created using a DISTINCT Filter against the DomainList table, ClientDomains

 

The Location table holds some user data but also the domains. 

 

displaynameDomain
Joe Bloggs (ABC)www.abc.com
Jane Doe (NFC)www.nfc.com
Fred Willis (ABC)www.abc.com
Mara Wilson (Test)www.test.com
Lina Gonzalez (XYZ)www.xyz.com

 

The DomainList table determines what domains can access what dashboard.

 

DomainClientName
www.abc.comLetters Corp
www.xyz.comLetters Corp
www.test.comTest Corp
  
  

 

Using hardcoded domains (which won't work for this solution) I created a table called ClientDomains. This was to format the domains filter put against the Location table to mirror code that had worked when it was hardcoded;

 

[Domains] IN {
"www.abc.com",
"www.xyz.com"
}

 

Accordingly, the ClientDomains table looks like this;

 

ClientNameDomains
Letters Corp{"www.abc.com", "www.xyz.com"}
Test Corp{"www.test.com"}

 

I have tried using FILTER as below, which returns nothing but does not trigger a syntax error

 

FILTER(ALL ('ClientDomains'[ClientName]),
CONTAINSROW(
{
"Test Corp"
}, [Domains]
)

)

 

I've also tried using LOOKUPVALUE, SELECTEDVALUE, SELECTCOLUMNS and all of these generate syntax errors.

 

Ideally, if I can get Power BI to return the string I have created in the ClientDomains table and then parse that through the filter in RLS, it will work. IDK if I'm totally off base and need to use Concateanex to create those strings inside the RLS Table Filters.. Can someone please give me some pointers on this? 

1 REPLY 1
amitchandak
Super User
Super User

@DataSaurus , In the RLS filter, you cannot go across the table. You can filter on more than one table individually. Try to relate the access only to email in the table

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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