Forum Discussion
RLS problems with Direct Query
- 1 year ago
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.
- 1 year ago
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:
- Test with Pro users to see if the error persists (PPU may have limitations).
- Simplify your RLS logic to avoid complex DAX functions.
- Ensure dataset refreshes are successful and RLS is correctly applied.
- Check if there are issues with the DirectQuery connection settings or data model.
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.