How to Analyze DAX Queries in Fabric Models Using Power BI Performance Analyzer
You can look at DAX queries in Fabric Models by using Power BI Performance Analyzer. This tool lets you record and check how fast queries run. Checking performance helps you find slow spots and make your reports better. This is very helpful when you use Direct Lake mode. Direct Lake mode lets you ask for big sets of data right from OneLake. But if you do not handle memory and paging well, things can get slow. Be careful of common problems like tricky relationships, slow queries, or wrong data types. Tools like DAX Studio or Tabular Editor with Power BI Performance Analyzer can help you study your queries better.
Key Takeaways
Use Power BI Performance Analyzer to find slow DAX queries and visuals in your Fabric Models.
Connect Power BI Desktop to your Fabric Model with the SQL Endpoint to start checking queries easily.
Keep your data model simple with a star schema, easy relationships, and better tables for faster DAX.
Save and send DAX queries to tools like DAX Studio for more study and fixing problems.
Follow best steps like using fewer visuals, adding variables, and testing changes often to make your reports faster and work better.
Power BI Performance Analyzer Basics
What It Does
Power BI Performance Analyzer lets you see how your reports work. You can check how long each visual takes to show up. This helps you find out where things are slow. When you use the analyzer, it keeps track of the time for DAX queries, showing visuals, and other tasks. This helps you find which visuals or queries are slow.
Here are some main things you can do with Power BI Performance Analyzer:
Watch how fast visuals load, including getting data and showing it.
Find slow spots by seeing which visuals or queries take longer.
Try changes and run the analyzer again to see if things get faster.
Make queries better by looking at the SQL or DAX sent to your data source, so you can improve your data model.
Tip: You can save the performance data and look at it more in tools like DAX Studio.
Why Use with Fabric Models
When you use Fabric Models, especially with Direct Lake or semantic models, Power BI Performance Analyzer is even more useful. You can see how visuals ask for data and how long it takes to get answers. For Direct Lake semantic models, the analyzer shows if queries use Direct Lake or switch to DirectQuery. This is important because switching can make your report slower.
You connect Power BI Desktop to your Fabric Model, make visuals, and start recording with the analyzer. When you refresh visuals, you can check if DAX queries use Direct Lake or DirectQuery. If you see DirectQuery taking time, your query might be too hard or use things that are not supported. You can then change your model or queries to fix these problems.
Note: Even with Direct Lake, you still need to make your DAX queries and model better. The analyzer helps you see when queries are too hard or when memory slows things down.
Prepare Your Fabric Model
Connect in Power BI Desktop
To check DAX queries in your Fabric Model, you must connect Power BI Desktop to your data. Here are the steps to get ready:
Turn on Fabric for your group and sign up if you have not done this yet.
Make a new workspace in Microsoft Fabric and pick the right capacity. Use a test workspace, not one for real work.
Build a Lakehouse in your workspace to keep your raw data.
Bring data into the Lakehouse with Power Query Online. Clean and check your data during this step.
Change and organize your data. Make fact and dimension tables to help with modeling.
Share your Lakehouse data using a SQL Endpoint in Fabric.
Open Power BI Desktop and connect to the SQL Endpoint. Now you can use your changed data.
Set up your data in Power BI by making relationships and adding calculated columns or measures.
Make reports and dashboards that people can use. Give users the right permissions.
Tip: Always refresh your model after you make changes. This makes sure your reports show the newest data.
Model Setup Tips
A good model helps you get the right DAX query results. Try these tips to make your Fabric Model better:
Do not use Direct Lake tables for calculated tables. Use Import mode tables for hard changes.
Make one Date table with DAX functions like
CALENDAR
. Mark it as a Date Table for time tasks.Set up single-direction, many-to-one links from your Date table to fact tables.
Use 'Sort by Column' on time fields to keep your visuals in order.
Group your measures, like 'Current' and 'Previous', to make things clear.
Check calculated columns in the right visual to avoid blanks.
Refresh your model after you change its structure.
Follow DAX best practices: use clear names, add comments to hard code, and use variables for speed.
Test DAX expressions to make sure they are right and fast before you publish.
Use tools like Tabular Editor and DAX query view to write and check DAX easily.
Note: VertiPaq Analyzer helps you check how your model uses memory and compresses data. This lets you find and fix problems early.
Capture DAX Queries
To study DAX queries in your Fabric Model, you first need to capture them with Power BI Performance Analyzer. This tool shows how your report visuals talk to your data model. It also lets you save queries for a closer look later.
Start Recording
Follow these steps to start capturing DAX queries:
Open your PBIX file in Power BI Desktop.
Click the View tab, then pick Performance Analyzer to open its panel.
Press Start Recording to begin tracking what happens.
Click on your report visuals or use Refresh visuals. This will capture the time it takes for DAX queries to run and show up.
Look at the data you collect to find slow spots.
Tip: You can clear the list whenever you want. This helps you focus on certain visuals or actions.
Interact with Visuals
When you click, filter, or drill through visuals in Power BI Desktop, Power BI makes DAX queries based on what you do. Each visual asks the data model for information. Power BI Performance Analyzer catches these queries and shows how long they take.
For example, if you add a 'Country' column and sum 'Sales', Power BI builds a DAX query to show sales by country. If you have lots of visuals on one page, each one can make its own DAX query. This can make the total time longer and cause some visuals to wait.
If you use fewer visuals, you will have fewer DAX queries. This can make your report faster. Power BI Performance Analyzer helps you see which visuals are slow. You can change your report to make it work better.
Note: Every time you cross-filter or drill, new DAX queries are made. Fewer visuals mean fewer queries and quicker reports.
Export Query Data
After you record, you can save DAX queries to study them more or fix problems. Power BI Performance Analyzer lets you do this in a few ways:
In the Performance Analyzer panel, click Export to save the data as a JSON file (like PowerBIPerformanceData.JSON).
Open DAX Studio and click Load Perf Data to bring in the JSON file.
DAX Studio shows all the queries it found. You can sort them by how long they take to find slow ones.
Double-click a query to copy its DAX code into DAX Studio’s window. You can run the query and use special tools like Query Plan and Server Timings.
You can also copy single DAX queries from the Performance Analyzer panel to check them quickly in DAX Studio.
Saving DAX queries lets you:
Write, run, and fix queries outside Power BI.
Look at query plans and server timings to find slow spots.
Share query data with your team or keep it for later.
Use DAX Studio’s tools to find slow visuals and see how the engine works.
Tip: DAX Studio connects right to your Power BI model with the External Tools ribbon. This gives you more ways to check things, like cache and server traces, for better DAX query details.
Optimize DAX Performance
Read Performance Data
When you use Power BI Performance Analyzer, you get timing results for each visual and DAX query. Focus on these numbers to see where your report is slow. The tool shows how much time different parts of the engine use. Here is a table to help you understand the main performance metrics:
Look at the DAX Query Time first. This number shows how long the query takes. If this number is high, the query needs fixing. You can also check Visual Display Time to see if showing the visual is slow. Always compare times before and after you make changes. This helps you know if your changes worked.
Tip: Use DAX Studio to copy and check slow queries. You can see which measures or expressions take the most time.
Find Bottlenecks
You can find bottlenecks by looking for visuals or queries with high times. Here are some common problems you might see in Fabric Models:
Slow DAX measures, like repeated calculations or using SUMX and FILTER on big tables.
Too many visuals on one report page, which makes more queries and slows things down.
High-cardinality fields (like Transaction ID) in slicers or visuals, causing heavy data loads.
Extra cross-filtering between visuals, leading to more queries.
High CPU, memory, or I/O use during refreshes or when using reports.
Large data sets that make the engine scan whole tables and use more resources.
High-cardinality relationships that make joins slow and costly.
Use Power BI Performance Analyzer to find which visuals or queries are slow. If you see a visual with a long DAX Query Time, copy the query and check it in DAX Studio. Look for things like repeated calculations, big table scans, or missing variables.
Note: Tools like Power BI Capacity Metrics App or Azure Monitor help you track resource use and spot trends over time.
Apply Best Practices
You can make DAX faster in Fabric Models by following good steps. Here are some best practices to help you:
Build a clean data model. Use a star schema with clear fact and dimension tables. Remove extra columns and tables.
Use VertiPaq Analyzer in DAX Studio to find columns or tables that use too much memory.
Use calculated measures instead of calculated columns. Measures use less memory and refresh faster.
Limit iterator functions like SUMX, AVERAGEX, and FILTER. These can slow down queries if used on big tables.
Use variables in your DAX code. Variables save results and stop repeated calculations.
Make relationships simple. Use single-direction relationships and avoid high-cardinality joins.
Keep visuals simple. Fewer visuals per page means fewer queries and faster loading.
Make slicers and filters better. Use hierarchy slicers and limit how many slicers you use.
Turn on query folding in Power Query. This sends changes to the data source and makes refreshes faster.
Use incremental refresh for big datasets. This loads only new or changed data, saving time and resources.
Pre-warm the Direct Lake cache and keep Delta tables clean with VACUUM and OPTIMIZE commands for better speed.
Test and watch performance after each change. Use Power BI Performance Analyzer to see if things get better.
Tip: Use the Best Practice Analyzer in Tabular Editor to check your model for common problems and get ideas for fixes.
If you still see slow queries after these steps, try these troubleshooting tips:
Check if the slowdown happens during data loading, refresh, or when showing the report.
Remove extra relationships and columns from your model.
Avoid hard or nested DAX calculations.
Set data refreshes for times when fewer people use the system.
Upgrade your capacity or hardware if you see high resource use.
Use performance monitoring tools for deeper checks.
You should always match your optimization steps to your storage mode. Import mode works best with in-memory caching and scheduled refreshes. Direct Lake mode needs changes at the source, like partitioning and indexing, for real-time speed.
Remember: Check your model and queries often. Small changes can make your reports much faster and easier to use.
You can make sure your Fabric Models work well by using simple steps. First, use Power BI Performance Analyzer to record and look at queries. Check your reports often, not just one time, so you can find slow visuals early and fix them. Try built-in tools and outside tools like DAX Studio to spot problems, make queries better, and handle big models. If you watch your reports often and work with your team, you can give users fast and trustworthy reports that help the business.
FAQ
How do you know if a DAX query uses Direct Lake or DirectQuery?
You can check this in Performance Analyzer. Look at the query details for storage mode. If it says "Direct Lake," the query is fast. If it says "DirectQuery," it might be slower.
Can you analyze DAX queries without DAX Studio?
Yes, you can use just Power BI Performance Analyzer. This tool lets you record and save DAX queries. DAX Studio has more features for deep checks, but you do not need it for simple reviews.
What should you do if a visual loads slowly?
First, use Performance Analyzer to find the slow visual. Copy the DAX query and check it in DAX Studio. Try to make the visual simpler or use less data. Change the DAX code to make it better. Test your changes to see if it gets faster.
Does changing the data model affect DAX performance?
Yes, changing the model can change how fast queries run. A clean star schema and fewer columns help DAX go faster. Simple relationships also help. Always check your model after changes. Use Performance Analyzer to see if things improve.