cancel
Showing results for 
Search instead for 
Did you mean: 
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
RicoZhou
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.

@RicoZhou 

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

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 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.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors