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
haputhanthree
Frequent Visitor

RLS - Direct Query (function containsrow" is not allowed)

function containsrows is not allowed as a part of row level security on direct query models. 

haputhanthree_0-1634802987515.png


I have blow data structure on backend.

1. Select PBI user and user group.

haputhanthree_1-1634803090169.png

 

2. Each group have customers and these customers Id's should used to filter the sales table.

haputhanthree_2-1634803148462.png

3. Sales table

haputhanthree_3-1634803212046.png

RLS Query Used
[Customer_ID] IN
--get customers assigned to group
SELECTCOLUMNS(
FILTER(
Group_Customers
,Group_Customers[Group_ID] =
--get group ID of there PBI User
SELECTCOLUMNS(
FILTER(
Users
,Users[Emil] = USERPRINCIPALNAME()
), "Group_ID" ,Users[Group_ID]
)
) , "Customer_ID", Group_Customers[Customer_ID]
)


This works fine with the import mode but not in the direct query mode. appreciate your support on this. 

 



2 REPLIES 2
v-rzhou-msft
Community Support
Community Support

Hi @haputhanthree 

This issue means that direct query doesn't support IN or Containsrow function. You may update your code in RLS, try equal.

For reference:

Row Level Security on a DirectQuery to Power BI dataset composite model My Findings

 

Best Regards,
Rico Zhou

 

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

@v-rzhou-msft 

Thank you!, but equal does not work for this scenario since it returns more than one Customer_ID.

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.