Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hi folks,
I have a report that had a table connection recently changed to Direct Query, since then some of my RLS functions are not working as they should and I keep getting the "CONTAINSROW is not allowed on Direct Query". But here is the catch, I don't have any RLS functions that use CONTAINSROW nor anything similar to it, what I do have is something similar to:
[VENDOR] == "Vendor 1"
With that, I assign the Vendor to its function, and it usually works, but since the change some of the users are receiving the error that I mentioned. Does anyone know what can be the error?
Here is the list os the things that I already tried:
The only difference between these users is that the users receiving the error are using the "Premium per User" license, and the ones that do not receive the error use the "Pro" license, but I also tried to swap their licenses and had no effect.
Solved! Go to Solution.
Hi @PedroFarias - The issue you're experiencing with CONTAINSROW and Direct Query after switching the connection mode, despite not explicitly using the function in your RLS (Row-Level Security), is likely caused by an indirect relationship between how Power BI interprets your RLS expressions and the limitations of Direct Query.
If [VENDOR] is coming from a related table (e.g., via a one-to-many or many-to-many relationship), ensure that the relationship is working as expected and does not introduce ambiguity.
For Direct Query, avoid bi-directional relationships or relationships involving calculated columns.
alternative:
If possible, switch back to Import mode, as it’s more forgiving with RLS and DAX expressions.
Implement RLS in the Source:
For Direct Query, consider implementing RLS directly in the source system (e.g., SQL Server, Azure SQL) to avoid Power BI limitations.
Split the Dataset:
Use a hybrid approach where only high-velocity data resides in Direct Query and other data is in Import mode. This can reduce the complexity of DAX expressions.
Proud to be a Super User! | |
Hi @PedroFarias
The "CONTAINSROW is not allowed on DirectQuery" error might be related to licensing differences between Premium Per User (PPU) and Pro licenses, as PPU users can face limitations with DirectQuery and RLS. Even though you're not using CONTAINSROW explicitly, Power BI might be generating queries that trigger unsupported operations in DirectQuery mode.
To fix the issue:
If it still doesn't work, consider contacting Microsoft support for further troubleshooting.
Hi @PedroFarias,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution and give a 'Kudos' so other members can easily find it.
Thank you.
Hi @PedroFarias,
Thanks for reaching out to the Microsoft forum community.
Could you please confirm if your query have been resolved? If they have, kindly mark the helpful response and accept it as the solution. This will assist other community members in resolving similar issues more efficiently.
Thank you.
Hi @PedroFarias
The "CONTAINSROW is not allowed on DirectQuery" error might be related to licensing differences between Premium Per User (PPU) and Pro licenses, as PPU users can face limitations with DirectQuery and RLS. Even though you're not using CONTAINSROW explicitly, Power BI might be generating queries that trigger unsupported operations in DirectQuery mode.
To fix the issue:
If it still doesn't work, consider contacting Microsoft support for further troubleshooting.
Hi @PedroFarias,
Thanks for reaching out to Microsoft forum community.
In addition to the helpful response provided by @rajendraongole1 , could you please confirm if your query have been resolved? If so, please accept it as a solution and leave a "Kudos" so other members can find it more easily.
Thank you.
Hi @PedroFarias ,
RLS applies to only viewer role it won't apply to any other roles.
Or you can remove RLS and try to test for the users it might give some more details.
Thanks,
Sai Teja
Hi @PedroFarias - The issue you're experiencing with CONTAINSROW and Direct Query after switching the connection mode, despite not explicitly using the function in your RLS (Row-Level Security), is likely caused by an indirect relationship between how Power BI interprets your RLS expressions and the limitations of Direct Query.
If [VENDOR] is coming from a related table (e.g., via a one-to-many or many-to-many relationship), ensure that the relationship is working as expected and does not introduce ambiguity.
For Direct Query, avoid bi-directional relationships or relationships involving calculated columns.
alternative:
If possible, switch back to Import mode, as it’s more forgiving with RLS and DAX expressions.
Implement RLS in the Source:
For Direct Query, consider implementing RLS directly in the source system (e.g., SQL Server, Azure SQL) to avoid Power BI limitations.
Split the Dataset:
Use a hybrid approach where only high-velocity data resides in Direct Query and other data is in Import mode. This can reduce the complexity of DAX expressions.
Proud to be a Super User! | |
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!