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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
regbacc
Frequent Visitor

Getting Dax Query plan for RLS when RLS is developed in Tabular Editor

Hi,

 

We have quite complex semantic model developed in Tabular Editor and published to Power BI Service. It includes dynamic RLS. We rely heavily on RLS and we want to improve performance of that part.

For that we are looking at capturing the DAX queries produced when RLS is applied. We tried different methods.

 

Unfortunately we cannot use performance analyzer in Power BI as the roles dont show when we are connected to this semantic model in Power BI service. I believe that it is because we are having a live connection to the semantic model.

 

We cannot user DAX studio either as the roles dont show in the dialog where you pick the roles

 

We have tried with SQL Server Profiler but got only info about the context of the query used to display the visuals but not the DAX query where RLS is applied.

 

Any suggestion to fecth those queries and plans would be highly appreciated.

 

Thanks in advance

Régis

1 ACCEPTED SOLUTION

A (very expensive) option is to sick Azure Log Analytics on that workspace.

View solution in original post

4 REPLIES 4
mashru
Frequent Visitor

Try including custom logging within your DAX measures. You can create measures that log certain conditions or states to a database or log file when RLS is applied. This method can add some overhead, but it can be effective for understanding how RLS affects specific queries. The idea is to create DAX measures that log information about the execution context, such as which RLS filters are being applied or the number of rows affected by those filters. This information can then be stored in a database, a table within your Power BI model, or an external file for analysis.

lbendlin
Super User
Super User

RLS will be ignored for anyone above Viewer access in the workspace.  Have an app user or workspace viewer run this. 

 

If parts of your semantic model are in Direct Query then you can use the data source query logs.

Only import mode. No direct query. So I guess no solution for getting DAX query or query plans

A (very expensive) option is to sick Azure Log Analytics on that workspace.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.