Performance Analyzer is a tool within Power BI desktop, that allows you assess your report’s performance and identify area of improvement. Using this you can identify the time taken by each visual to query for its data and render the result.
It returns a log that measure in time duration (in millisecond), how each of your report elements such as visuals, DAX formulas are performing when user interact with the report.
By examining the durations in the logs, you can easily identify which elements of the report are the most, or least resource intensive.
Now the question is why do we need of using Performance Analyzer ?
Once you create a Power BI report, its not that just enough until you are satisfied with report performance.
If report’s loading time is higher than expectation time then surely it may disappoint you as well client/user who are consuming the report on Power BI Service, so the report performance is also one of major task that you can not avoid. Specially in case, when your report having a complex DAX formulas, multiple tables in data model .
So, in order to improvising or optimizing the report performance you need to investigate the root cause of issues those are impacting the report performance also you may have to tune your DAX formulas.
Running Performance Analyzer
Before you run Performance analyzer, ensure that you have cleared the visual cache and data engine cache otherwise, the results will not be accurate.
Lets see what is visual cache and data engine cache:
- Visual cache: When visuals are loaded in report page, you can not clear the visual cache without closing Power BI Desktop and opening it again, so to avoid any caching in play, you need to start your analysis with a clean visual cache. In order to clear a visual cache, you can add a blank page to your report and then, with that page selected, save and close that report. Now reopen the report that you want to analyze. It will open on the blank page, that ensures that no cache are saved when report is opened with bank page as there is no visual in report page.
- Data engine cache : When a query is run, the query results are cached, so the results of your analysis will be inaccurate, so you need to clear the data cache before rerunning the visual. To clear the data cache, you can either restart Power BI Desktop or connect DAX Studio to the data model and then call clear cache.
Following is the report that we want to analyze.
Lets clear the visuals cache first, for this you need to add a blank page in this report as shown below.
After that with that blank page selected, save and close that report, now reopen the report that will be opened on the blank page.
Next we will run the Performance analyzer, go to the View tab, select Performance analyzer, and then select Start recording.
After clicking on start recording button, just click on report page that you want to analyze, here we click on Page1.
Now you will be wondering, why did we not open the report directly on page that we want to analyze, the reason is that when report is loaded, the visuals are cached which can impact analyze result. Therefore, we open the report on blank page first then start the recording and moved to page that we want to analyze.
Once you click on start recording, and click on Page1, you will see Performance Analyzer inspects and displays the duration necessary for updating or refreshing all visuals that user interactions initiate, and display the information in Performance Analyzer pane that you can view, drill down, or export the results.
It captures and displays the performance measurement information in real time. So each time you click on a visual, move a slicer, or interact in any other way, Performance Analyzer immediately displays the performance results in its pane.
Each visual’s log information includes the time duration (a time values in millisecond indicate the difference between a start and end timestamp for each operation) to complete the following categories of tasks:
- DAX query – if a DAX query was required, this is the time between the visual sending the query, and for Analysis Services to return the results.
- Visual display – This is the time that required for the visual to draw on the screen, including time required to retrieve any web images or geocoding.
- Other – This is time that is required by the visual for preparing queries, waiting for other visuals to complete, or performing other background processing.
When you are finished, you can stop the recording by clicking on the Stop button. Also can clear the log.
To clear out the information in the Performance Analyzer pane, select Clear. All information is removed and is not saved when you select Clear.
Lets examine the Matrix visual performance in the list to view more detailed information and identify the exact cause of the issue, such as the DAX query, the visual display, or other. Just expand the matrix visual log in Performance Analyzer pane.
You can see the time taken by DAX query is less that is 811 millisecond, and time taken to displaying a visual and other element is also less than a 2 second.
As this report is very simple and not using any complex DAX formulas that’s why it has not any performance issue also time duration is very less for each report element that is less than a 2 second.
In case, if you see that your DAX query is taking more time and you want to examine DAX query then you can click on Copy query and then paste it into DAX Studio for further analysis.
Lets copy query and paste it in DAX studio as shown below, before copying the query, first clear the cache then run the query.
In case, if you identify visuals is taking more time and causing the performance issue then you can consider the following points :
- Reduce the number of fields in each visual, identify the fields that are not valuable to the visual and then remove them.
- If you have too many visuals in report page, that can also impact the report performance. Reduce the number of visuals on the report page because fewer visuals means better performance. If a visual is not necessary and does not add value to the user/client then you can remove that visual.
You can select Refresh visuals in the Performance Analyzer pane to refresh all visuals on the current page of the report, and thereby have Performance Analyzer gather information about all such visuals.
Export the Performance Analyzer log report
You can also export and save the performance report, just click on Export button.
Once you click on Export, it asks you to save a .json file with information from the Performance Analyzer pane in your system.
Stop Performance Analyzer recording
If you are finished with analysing report performance then you can stop the recording.
Just click on Stop button in Performance Analyzer pane, then you can see, recording is stopped.
Stop and Refresh visuals button is disabled, and Start recording button is enabled so the next time you can again start the recording.