6.1 Performance Analyzer and DAX Query View
Key Takeaways
- Performance Analyzer captures the duration of each visual's query, including DAX query, DirectQuery, and rendering times.
- Start recording, clear cache, then interact with the report to get accurate measurements.
- DAX query view allows writing and testing DAX queries directly against the model without affecting reports.
- Long DAX query times indicate measure optimization is needed; long DirectQuery times indicate source optimization.
- Export Performance Analyzer results to JSON for detailed analysis and comparison over time.
Performance Analyzer and DAX Query View
Quick Answer: Performance Analyzer (View tab) records how long each visual takes to load, broken into DAX query time, DirectQuery time, and visual rendering time. Clear the cache first for accurate results. DAX query view (separate view in Desktop) lets you write and test DAX queries directly, helping identify slow measures before they reach reports.
Performance Analyzer
Accessing Performance Analyzer
View tab → Performance Analyzer → Start Recording
What It Measures
For each visual on the page, Performance Analyzer records:
| Metric | Description |
|---|---|
| DAX Query | Time for the VertiPaq engine to execute the DAX |
| Direct Query | Time for the source database to respond (DirectQuery only) |
| Other | Power BI internal processing |
| Visual Display | Time to render the visual in the browser |
| Total | Sum of all components |
Best Practice: Accurate Measurement
- Start recording from the Performance Analyzer pane
- Clear the visual cache: right-click the Performance Analyzer area → Refresh Visuals (or press Ctrl+Shift+F5)
- Interact with the report (change slicers, navigate pages)
- Stop recording and analyze results
Why clear cache? Without clearing, Power BI may serve cached results, making visuals appear faster than they actually are for first-time users.
Interpreting Results
| Symptom | Likely Cause | Solution |
|---|---|---|
| Long DAX query time | Complex or inefficient measures | Optimize DAX formulas |
| Long DirectQuery time | Slow source database | Optimize source, add indexes |
| Long visual display | Too many data points in visual | Reduce cardinality, use Top N |
| Many visuals loading | Page has too many visuals | Reduce visual count, use bookmarks |
Copying the DAX Query
Click "Copy query" next to any visual to see the exact DAX sent to the engine. Paste it into DAX query view for further analysis and optimization.
DAX Query View
DAX query view is a dedicated view in Power BI Desktop for writing and testing DAX queries.
Accessing DAX Query View
Click the DAX query view icon in the left sidebar (looks like a code bracket), or:
View tab → DAX Query View
Writing DAX Queries
DAX queries use the EVALUATE keyword:
// Simple table evaluation
EVALUATE
Products
// Filtered evaluation
EVALUATE
FILTER(Products, Products[Category] = "Electronics")
// Measure testing with SUMMARIZE
EVALUATE
SUMMARIZECOLUMNS(
Products[Category],
"Total Revenue", SUM(Sales[Amount]),
"Order Count", COUNTROWS(Sales)
)
// Testing a complex measure
DEFINE
MEASURE Sales[Test Revenue YTD] = TOTALYTD(SUM(Sales[Amount]), 'Date'[Date])
EVALUATE
SUMMARIZECOLUMNS(
'Date'[Month Name],
"YTD Revenue", [Test Revenue YTD]
)
Benefits of DAX Query View
- Test measures before adding them to the model
- Debug complex DAX by examining intermediate results
- Compare performance of different DAX approaches
- Explore data without creating visuals
- Validate calculations against expected results
Model Performance Optimization Strategies
1. Reduce Model Size
- Remove unnecessary columns — every column consumes memory
- Remove unnecessary rows — filter historical data to relevant periods
- Reduce cardinality — high-cardinality columns (many unique values) compress poorly
- Avoid calculated columns when Power Query can do the same transformation
2. Optimize Data Types
- Use Whole Number instead of Decimal when possible (better compression)
- Use Date instead of Date/Time if time component is not needed
- Avoid Text columns with high cardinality for filtering
3. Reduce Granularity
If your fact table has one row per second but reports only need daily aggregation:
- Aggregate in Power Query before loading
- Use Group By to summarize to the needed level
- Smaller tables = faster queries
4. Improve Relationship Design
- Ensure integer keys for relationships (faster than text keys)
- Use star schema — avoid snowflake or complex relationship chains
- Minimize bi-directional cross-filtering
- Set Assume Referential Integrity for DirectQuery relationships
5. Optimize DAX Measures
- Use variables to avoid redundant calculations
- Avoid iterators (SUMX) when simple aggregations (SUM) suffice
- Use DIVIDE() instead of IF checks for division
- Minimize use of FILTER() inside CALCULATE — prefer direct column filters
- Avoid DISTINCTCOUNT on high-cardinality columns when possible
On the Exam
The PL-300 frequently tests:
- Using Performance Analyzer to identify slow visuals
- Interpreting Performance Analyzer results (DAX time vs. visual display time)
- Writing DAX queries in DAX query view for testing
- Strategies for reducing model size and improving performance
- Understanding the impact of cardinality on compression and query speed
A visual takes 8 seconds to load. Performance Analyzer shows: DAX query = 7.2s, Visual display = 0.8s. What should you optimize?
Why should you clear the visual cache before recording in Performance Analyzer?
Which of the following is the MOST effective way to reduce model size?