When Power BI reports start slowing down, the culprit is often hidden deep within your queries—an unnoticed transformation, an inefficient data source operation, or a poorly folded query. That’s where Query Diagnostics in Power BI comes in.
This powerful feature helps uncover what’s happening behind the scenes during data refreshes and transformations. Whether you’re working with large datasets, complex merges, or multiple data sources, Query Diagnostics can show you exactly where things are lagging—and why.
In this comprehensive blog, we’ll walk you through what Query Diagnostics is, why it matters, how to use it, and how to analyze the output to boost Power Query performance. We’ll also include a practical business scenario to show how it works in action.
What Is Query Diagnostics in Power BI?
Query Diagnostics is a feature inside Power BI’s Power Query Editor that helps you inspect and analyze how queries are executed. It captures low-level telemetry data while you’re performing data transformations, enabling you to trace each step and identify potential inefficiencies.
Key insights include:
- Which queries are being executed
- Which steps are slow or time-consuming
- What operations are being pushed to the source (query folding)
- Whether the delay is due to Power Query or the data source itself
Why Use Query Diagnostics?
Query Diagnostics is essential for:
- Improving Power BI performance
- Optimizing Power Query transformations
- Understanding query folding behavior
- Troubleshooting long data refresh times
- Identifying inefficient joins, filters, and data merges
Key Features and Use Cases
1. Monitor Query Execution Behavior
Track the actual SQL or native queries that Power Query sends to the data source. This is particularly useful for checking which transformations are being folded and whether filters, joins, and aggregations are delegated to the database.
2. Pinpoint Performance Bottlenecks
Query Diagnostics lets you measure time spent on each transformation step—helping you understand which steps are slowing down the overall refresh. This includes:
- Expensive joins
- Unfolded transformations
- Column type conversions
- Multiple source merges
3. Analyze Query Folding
Query folding is when Power Query pushes transformations to the source system (like SQL Server) rather than executing them in memory. Diagnostics helps you detect where folding breaks, so you can restructure your queries for better performance.
4. Diagnose Specific Query Steps
Using the “Diagnose Step” feature, you can focus on individual steps within a query to see how much time each one takes—ideal for fine-tuning your Power Query scripts.
5. Visualize Diagnostic Results
You can visualize the diagnostics output using custom Power BI charts and tables, or export the data for external analysis. This helps in identifying patterns or recurring performance issues across reports.
How to Use Query Diagnostics in Power BI
Here’s a step-by-step walkthrough:
Step 1: Open Power Query Editor

From Power BI Desktop:
Home > Transform data > Power Query Editor
Step 2: Enable Diagnostics

In Power Query Editor:

- Go to Tools > Start Diagnostics
- Perform the actions you want to diagnose (e.g., refresh a query, apply a transformation)
- Then click Stop Diagnostic
Tip: If your organization restricts admin access, go to Power BI Desktop > Options > Diagnostics, and enable “Query Editor Tracing”. This allows you to use diagnostics without full admin rights—though only within Power Query, not for full refreshes.
Step 3: Analyze the Diagnostic Output

After stopping diagnostics, Power BI generates up to three new tables:
- Diagnostics
- Detailed Diagnostics
- Query Step Diagnostics (if applicable)
Each row in these tables shows:
- The transformation step (e.g., Filter Rows, Merge Queries)
- Duration (how long it took)
- Data source activity (SQL query or API call)
Real-World Use Case: Troubleshooting a Slow Report
Scenario
You’re loading a large SQL Server table named SalesData into Power BI, but report refreshes are slow.
Diagnostics Results
| Step Name | Duration | Data Source Query |
| Navigation | 0.1 sec | SELECT * FROM sys.tables |
| Filter Rows | 1.5 sec | SELECT * FROM SalesData WHERE Region = ‘East’ |
| Merged Queries | 4.2 sec | Multiple joins across SalesData, CustomerData, Region |
Interpretation
- Navigation is fast—no issue.
- Filter Rows is efficient and folded to SQL.
- Merged Queries is the bottleneck—taking over 4 seconds. Consider optimizing joins or reducing dataset size.
Using the Diagnostic Tables in Reports

If you want to analyze diagnostics within a report:
- Save the diagnostic tables as queries.
- Optionally export them as JSON and re-import into Power BI.
- Use charts or matrices to visualize durations, sources, or specific transformation steps.
Tips to Optimize Based on Diagnostics
- Minimize Unfolded Steps: Move non-foldable steps (e.g., column renames, data type changes) to the end of the query chain.
- Simplify Merges: Filter datasets before merging to reduce row count.
- Reduce Column Count Early: Remove unnecessary columns as early as possible.
- Cache Intermediate Tables: For large transformations, consider staging the data in SQL or creating views.
Final Thoughts
Query Diagnostics in Power BI is more than just a developer tool—it’s a data performance analyzer, a debugging assistant, and a transformation guide. By leveraging its insights, you can fine-tune Power Query performance, reduce refresh times, and build faster, more reliable reports.
Whether you’re a BI developer, data analyst, or Power BI admin, mastering Query Diagnostics can drastically improve how you troubleshoot and optimize your models.




