
上QQ阅读APP看书,第一时间看更新
How it works...
- As report visualizations are refreshed or interacted with in Power BI, the DAX queries from each visual or tile are translated into SQL statements and utilize the source SQL statements to return the results.
- Be aware that Power BI does cache query results with DirectQuery models. Therefore, when accessing a recently utilized visual, a local cache may be used rather than a new query sent to the source.
- DAX Studio can provide visibility to the specific queries sent to the source.

Figure 30: DAX Studio Trace of a DirectQuery Power BI Desktop Model
- The SQL statements passed from Power BI to the DirectQuery data source include all columns from the tables referenced by the visual.
- For example, a Power BI visual with total sales grouped by product category would result in a SQL statement that selects the columns from both tables (for example, Product Color or Order Quantity) and implements the join defined in the model.
- However, as the SQL statement passed embeds these source views as derived tables, the relational engine is able to generate a query plan that only scans the required columns to support the join and aggregation.

Figure 31: Execution Plan of a DirectQuery SQL Statement