Sub topic 15
Checking your choice with Performance Analyzer
This chapter assumes you can build a star schema model in Power BI Desktop and write basic DAX measures. It also assumes you have read the earlier chapters on Import, DirectQuery, Direct Lake, and composite models. Picking a storage mode is a prediction about how your model will behave. Performance Analyzer lets you test that prediction with measurements.
What Performance Analyzer measures
Performance Analyzer is a pane in Power BI Desktop. It records what happens when a report page loads or a user interacts with a visual. For each visual it reports three durations:
| Metric | What it covers | What a high value suggests |
|---|---|---|
| DAX query | Time from sending the DAX query to the model until results return | Slow measure, slow storage engine scan, or slow source query in DirectQuery |
| Visual display | Time to draw the visual after data arrives | Too many data points, or a heavy custom visual |
| Other | Time spent waiting on other visuals, background work, or queuing | Too many visuals on one page competing for the same resources |
For storage-mode work, the DAX query duration matters most. In Import and Direct Lake the DAX query runs inside the VertiPaq engine. In DirectQuery it includes the round trip to the source. In a composite model it may include both.
Two measurements can mislead you if you ignore the cache. The first query after opening a file or after a refresh is a cold run. Later runs may use cached data or cached query results. Always record a cold run and a warm run separately.
Capture a baseline
Follow these steps for each storage mode or design you want to compare.
- Open the report in Power BI Desktop and go to the page you want to test.
- On the View tab, select Performance analyzer.
- Select Start recording.
- Select Refresh visuals to run every visual on the page. You can also click a slicer to test one interaction.
- Expand each visual in the pane to read its durations.
- Select Stop when you have enough runs.
- Use Export to save the results as JSON so you can compare them later.
Record at least three runs and note the slowest. Users feel the worst case, not the average.
Measure realistic interactions, not only the page load. A slicer change, a cross-filter from a bar chart, and a drill-through each produce different queries. DirectQuery problems often appear only on the interaction that touches the largest table.
Read the query behind a slow visual
Expand a visual in the pane and select Copy query. This copies the DAX query that the visual sent. A query from a simple visual looks like this:
EVALUATE
SUMMARIZECOLUMNS (
'Date'[Year],
"Total Sales", [Total Sales]
)
ORDER BY 'Date'[Year]The measure it references is the same in every mode:
Total Sales = SUMX ( Sales, Sales[Quantity] * Sales[UnitPrice] )The DAX text does not change between modes. What changes is where the work happens:
- Import and Direct Lake: the VertiPaq storage engine scans compressed columns in memory. The formula engine then combines the results.
- DirectQuery: the engine translates the work into one or more SQL queries. The source database runs them and returns rows.
You can paste the copied query into DAX Studio and run it with Server Timings turned on. Server Timings splits the duration into storage engine time and formula engine time. A high storage engine time points to data volume or source speed. A high formula engine time points to the DAX itself, such as an iterator over a large table or a complex measure.
Interpret results by storage mode
The same symptom has different causes depending on the mode. Use the table below as a starting point.
| Symptom | Import | DirectQuery | Direct Lake |
|---|---|---|---|
| First query slow, later queries fast | Cold cache after refresh | Source warming its own cache | Columns being loaded into memory for the first time |
| Every query slow | Large high-cardinality columns or heavy DAX | Slow source, missing indexes, non-foldable logic | Fallback to DirectQuery, or heavy DAX |
| Slow only after data update | Refresh just finished and cache is empty | Not usually affected | Reframing evicted columns, so they reload |
| Slow only with certain slicers | Relationship on a high-cardinality column | Joins across large tables | Same as Import, unless fallback occurred |
Import
Import queries are usually fast because the data is compressed in memory. If an Import visual is slow, look at the model before the storage mode. Common causes are text columns with millions of distinct values, bi-directional relationships, and measures that iterate over a large table row by row. Remove unused columns, reduce cardinality (for example, split a datetime into a date and a time), and rewrite the iterator.
DirectQuery
DirectQuery duration includes the source. Performance Analyzer in Desktop also lists the queries sent to the source if you expand the visual, and you can copy the SQL. Run that SQL directly in the source tool and read its execution plan. If the SQL is slow there, the fix is at the source: indexes, partitioning, or a pre-aggregated table.
Also check how many SQL queries one visual produces. A visual with several measures can send several queries. A page with twenty visuals multiplies that number, and many users opening the report at once multiply it again. Reduce visuals per page, or add an aggregation table (see the earlier chapter on aggregations) so that most queries stay in memory.
Direct Lake
Direct Lake behaves like Import once columns are loaded. A slow first query is expected, because the engine reads the needed columns from the Delta files in OneLake. If queries stay slow, check whether the model fell back to DirectQuery. Fallback happens when the model exceeds a capacity guardrail, when the source has features Direct Lake cannot read, or when security is defined at the SQL endpoint. A fallback query is as slow as DirectQuery against the SQL endpoint.
To check, use the Performance Analyzer or a Fabric tool that shows the query's storage mode, such as a trace in DAX Studio or SQL Server Profiler. Look for events that indicate DirectQuery activity on a model you expected to be fully in memory. If you see them, find the cause, such as a view as the source or data volume above the guardrail for your capacity SKU, and remove it. Also check the Delta table layout. Many small files, or very large row groups written without optimization, slow the column load. Compacting files with the table maintenance feature in the Lakehouse often helps.
Test the cold and warm paths
Storage modes differ most in what a cold run costs. Use this routine:
- Cold run: open the file or trigger a refresh or reframe, then run the page once. Record the times.
- Warm run: refresh visuals again without changing anything. Record the times.
- Interaction run: change a slicer to a value that has not been queried before. Record the times.
If the warm run is much faster than the cold run, users who arrive right after a data update will see the slow path. For Import, you can warm the cache with a scheduled query after refresh. For Direct Lake, you can run a few typical queries after a reframe so that common columns load before users arrive.
Test with realistic conditions
A fast result on your laptop with a sample may not hold in production. Check these conditions before you trust a result:
- Data volume: test with production-sized data, not a sample. DirectQuery and Direct Lake differences show up only at scale.
- Concurrency: Performance Analyzer in Desktop measures one user. Use the Power BI service and capacity metrics for load from many users.
- Capacity size: Direct Lake guardrails and memory limits depend on the capacity SKU. A result in a large capacity may not carry over to a smaller one.
- Network: DirectQuery adds latency between Power BI and the source, and between the user and the service. A source in another region slows every query.
- Security: row-level security adds filters to every query. Test with a role applied, because a role can change the query plan and the result. In Desktop, use View as to test with the role.
Decide what to change
Use the measurements to choose one of these actions. Change one thing at a time and measure again.
- Fix the model: remove columns, reduce cardinality, simplify relationships. This helps every mode.
- Fix the DAX: replace nested iterators and avoid measures that scan a large table many times.
- Fix the source: add indexes or pre-aggregate in DirectQuery, and compact Delta files for Direct Lake.
- Add aggregations or switch dimension tables to Dual so that more queries stay in memory.
- Change the storage mode: move a table from DirectQuery to Import if freshness requirements allow, or move to Direct Lake if the data already sits in OneLake.
Changing the storage mode is the most expensive action, so try it last. Many slow reports are caused by model design or DAX, and a different mode would not fix them.
A short worked comparison
Suppose a sales report has a page with one card, one line chart by month, and one table by product. You test it in two designs. The first uses DirectQuery against a warehouse. The second uses Direct Lake on the same data.
In Performance Analyzer, the DirectQuery cold run shows the line chart at 3,800 ms of DAX query time. Copying the query and the SQL shows a scan of the full fact table with no date index. After a warm run it still takes 2,900 ms, so the cache is not the cause. The source is the bottleneck.
The Direct Lake cold run shows 1,400 ms, because the date and amount columns load for the first time. The warm run shows 90 ms. The table visual stays at 90 ms with no fallback events in the trace. The result supports choosing Direct Lake here, provided the capacity can hold the model and the freshness fits the need.
If instead the Direct Lake warm run had stayed near 2,900 ms, you would suspect fallback and check guardrails before concluding anything about the mode.
Exercise
A DirectQuery report page has twelve visuals. Performance Analyzer shows each visual's DAX query takes about 600 ms on a warm run, but the page feels slow, and the "Other" duration is large. What are two likely causes, and what is one action for each?
Show answer
First, the visuals send many source queries at once, and they wait on each other, which shows up as "Other" time. Reduce the number of visuals on the page or add an aggregation table so that more queries are answered in memory. Second, the source database may be slow to run many concurrent queries, so each query queues. Add indexes or pre-aggregate the data at the source, and check the source's execution plan for the SQL you copied from the visual.
Exercise
A Direct Lake model gives 1,500 ms on the first query and 80 ms on the second. A colleague says Direct Lake is slow. How do you respond, and what result would make you suspect a real problem?
Show answer
The first query includes loading the needed columns from OneLake into memory, so a slow cold run is expected. The 80 ms warm run shows normal in-memory speed. A real problem would be warm queries that stay slow, for example near DirectQuery timings, which suggests fallback to DirectQuery. Then you check guardrails, source features such as views, and whether security is defined at the SQL endpoint.