(Optional) Optimize model performance
Review a DirectQuery model design
Note: This demo uses a different Power BI Desktop file.
-
Open the D:\PL300\Demo\Resources\AW Sales Analysis.pbix file.
-
If prompted to connect to the data source, click Connect.
-
At the bottom-right corner, point out that the data model comprises DirectQuery tables.
-
Save the Power BI Desktop file to the D:\PL300\Demo\MySolution folder.
-
In Model view, introduce the model design, which includes two related tables.
-
In Report view, interact with the report by selecting different items in the Fiscal Year slicer.
-
Drill through on any month column to reveal order details.
-
Return to the Sales Summary page.
Review query performance
-
On the View ribbon tab, show the Performance Analyzer pane.
-
Refresh the visuals, and then expand the slicer and Sales by Month visual.
-
Point out that they used DirectQuery mode (data was requested from the data source).
Configure Dual storage tables
-
In Model view, select the Date table, and then select the storage mode to Dual.
-
When the data has imported, switch to Report view, and then in the Performance Analyzer pane, refresh the visuals.
-
Point out that the Date table is now queried from the model cache.
Create aggregations
-
Open the Power Query Editor window, and in the Queries pane, duplicate the Reseller Sales query.
-
Rename the new query Reseller Sales Agg.
-
Apply a group by transformation, as follows:
-
Group by OrderDate.
-
New column: Sales, which is the sum of the SalesAmount column.
-
-
Close and apply the queries.
-
In Model view, set the storage mode for the Reseller Sales Agg table to Import.
-
Create a relationship from the Date table Date column to the Reseller Sales Agg table OrderDate column—ensure that the column cardinality is set to one-to-many, with the Date table on the one-side.
-
Manage aggregations on the Reseller Sales Agg table:
-
OrderDate: Group by the Reseller Sales table OrderDate column.
-
Sales: Sum the Reseller Sales table SalesAmount column.
-
-
Point out that the aggregation table is now hidden.
-
Switch to Report view, and in the Performance Analyzer pane, and then refresh the visuals.
-
Point out that the Sales by Month table is now queried from the model cache.
-
Drill through from any month, and point out that the details in the table are requested as DirectQuery from the data source.
-
Save the Power BI Desktop file.
-
Close Power BI Desktop.
Note: You will not use this Power BI Desktop solution again.