• Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy
Thursday, May 15, 2025
newsaiworld
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us
No Result
View All Result
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us
No Result
View All Result
Morning News
No Result
View All Result
Home Artificial Intelligence

Get Efficiency Knowledge from Energy BI with DAX Studio

Admin by Admin
April 23, 2025
in Artificial Intelligence
0
Businessman 2245116 1280.jpg
0
SHARES
0
VIEWS
Share on FacebookShare on Twitter

READ ALSO

Parquet File Format – All the pieces You Must Know!

Survival Evaluation When No One Dies: A Worth-Based mostly Strategy


To place issues straight: I can’t talk about how you can optimize DAX Code at the moment.

Extra articles will observe, concentrating on frequent errors and how you can keep away from them.

However, earlier than we are able to perceive the efficiency metrics, we have to perceive the structure of the Tabular mannequin in Energy Bi.
The identical structure applies to Tabular fashions in SQL Server Evaluation Providers.

Any Tabular mannequin has two Engines:

  • Storage Engine
  • System Engines

These two have distinct properties and fulfill completely different duties in a Tabular mannequin.

Let’s examine them.

Storage Engine

The Storage Engine is the interface between the DAX Question and the info saved within the Tabular mannequin.

This Engine takes any given DAX question and sends queries to the Vertipaq Storage engine, which shops the info within the information mannequin.

The Storage Engine makes use of a language known as xmSQL to question the info mannequin.

This language relies on the usual SQL language however has fewer capabilities and helps solely easy arithmetic operators (+, -, /, *, =, <>, and IN).

To combination information, xmSQL helps SUM, MIN, MAX, COUNT, and DCOUNT (Distinct Rely).

Then it helps GROUP BY, WHERE, and JOINs.

It’ll assist in case you have a fundamental understanding of SQL Queries if you attempt to perceive xmSQL. For those who don’t know SQL, will probably be useful to be taught the fundamentals when digging deeper into analyzing bad-performing DAX code.

A very powerful truth is that the Storage Engine is multi-threaded.

Subsequently, when the Storage Engine executes a question, it should use a number of CPU-Cores to hurry up question execution.

Lastly, the Storage Engine can Cache queries and the outcomes.

Consequently, repeated execution of the identical question will velocity up the execution as a result of the outcome will be retrieved from the cache.

System Engine

The System Engine is the DAX engine.

All capabilities, which the Storage Engine can not execute, are executed by the System Engine.

Normally, the Storage Engine retrieves the info from the info mannequin and passes the outcome to the System Engine.

This operation is named materialization, as the info is saved in reminiscence to be processed by the System Engine.

As you possibly can think about, it’s essential to keep away from massive materializations.

The Storage Engine can name the System Engine when an xmSQL-Question comprises capabilities that the Storage Engine can not execute.
That is operation id known as CallbackDataID and ought to be prevented, if potential.

Crucially, the System engine is single-threaded and has no Cache.

This implies:

  • No parallelism through the use of a number of CPU Cores
  • No re-use of repeated execution of the identical question

This implies we need to offload as many operations as potential to the Storage engine.

Sadly, it’s unattainable to instantly outline which a part of our DAX-Code is executed by which Engine. We should keep away from particular patterns to make sure that the proper engine completes the work within the least period of time.

And that is one other story that may fill complete books.

However how can we see how a lot time is utilized by every Engine?

Getting the Efficiency information

We have to have DAX Studio on our machine to get Efficiency Metrics.

We are able to discover the obtain hyperlink for DAX Studio within the References Part under.

For those who can not set up the Software program, you may get a conveyable DAX model from the identical web site. Obtain the ZIP file and unpack it in any native folder. Then you can begin DAXStudio.exe, and also you get all options with out limitations.

However first, we have to get the DAX Question from Energy BI.

First, we have to begin Efficiency Analyzer in Energy BI Desktop:

Determine 1 – Begin Efficiency Analyzer in Energy BI Desktop (Determine by the Creator)

As quickly as we see the Efficiency Analyzer Pane, we are able to begin recording the efficiency information and the DAX question for all Visuals:

Determine 2 – Begin recording of Efficiency information and DAX question (Determine by the Creator)

First, we should click on on Begin Recording

Then click on on “Refresh Visuals” to restart the rendering of all Visuals of the particular web page.

We are able to click on on one of many rows within the record and see that the corresponding Visible can be activated.

Once we develop on one of many rows within the report, we see a couple of rows and a hyperlink to repeat the DAX question to the Clipboard.

Determine 3 – Choose the Visible and duplicate the question (Determine by the Creator)

As we are able to see, Energy BI wanted 80’606 milliseconds to finish the rendering of the Matrix Visible.

The DAX question alone used 80’194 milliseconds.

This can be a extremely poor-performing measure used on this visible.

Now, we are able to begin DAX Studio.
In case we’ve DAX Studio put in on our machine, we’ll discover it within the Exterior Software Ribbon:

Determine 4 – Begin DAX Studio as an Exterior Software (Determine by the Creator)

DAX Studio will robotically be linked to the Energy BI Desktop file.

In case that we should begin DAX Studio manually, we are able to manually connect with the Energy BI file as effectively:

Determine 5 – Manually join DAX Studio to Energy BI Desktop (Determine by the Creator)

After the connection is established, an empty question is opened in DAX Studio.

On the underside a part of the DAX Studio Window, you will notice a Log part the place you possibly can see what occurs.

However, earlier than pasting the DAX Question from Energy BI Desktop, we’ve to start out Server Timings in DAX Studio (Proper prime nook of the DAX Studio Window):

Determine 6 – Begin Server Timings in DAX Studio (Determine by the Creator)

After pasting the Question to the Empty Editor, we’ve to Allow the “Clear on Run” Button and execute the question.

Determine 7 – Enabling “Clear on Run” Characteristic (Determine by the Creator)

“Clear on Run” ensures the Storage Engine Cache is cleared earlier than executing the Question.

Clearing the Cache earlier than measuring efficiency metrics is one of the best observe to make sure a constant place to begin for the measurement.

After executing the question, we’ll get a Server Timings web page on the backside of the DAX Studio Window:

Determine 8 – Server Timings Window in DAX Studio (Determine by the Creator)

Now we see loads of info, which we’ll discover subsequent.

Decoding the info

On the left facet of Server Timings, we’ll see the execution timings:

Determine 9 – Execution Timings (Determine by the Creator)

Right here we see the next numbers:

  • Whole – The entire execution time in milliseconds (ms)
  • SE CPU – The sum of the CPU time spent by the Storage Engine (SE) to execute the Question.
    Normally, this quantity is larger than the Whole time due to the parallel execution utilizing a number of CPU Cores
  • FE – The time spent by the System Engine (FE) and the share of the full execution time
  • SE – The time spent by the Storage Engine (FE) and the share of the full execution time
  • SE Queries – The variety of Storage Engine Queries wanted for the DAX Question
  • SE Cache – Using Storage Engine Cache, if any

As a rule of thumb: The bigger the share of Storage Engine time, in comparison with System Engine time, the higher.

The center part exhibits a listing of Storage Engine Queries:

Determine 10 – Checklist of Storage Engine queries (Determine by the Creator)

This record exhibits what number of SE Queries have been executed for the DAX Question and contains some statistical columns:

  • Line – Index line. Normally, we is not going to see all of the traces. However we are able to see all traces by clicking on the Cache and Inner buttons on the highest proper nook of the Server Timings Pane. However we is not going to discover them very helpful, as they’re an inner illustration of the seen queries. Generally it may be useful to see the Cache queries and see what a part of the question has been accelerated by the SE Cache.
  • Subclass – Usually “Scan”
  • Period – Time spent for every SE Question
  • CPU – CPU Time spent for every SE Question
  • Par. – Parallelism of every SE Question
  • Rows and KB – Dimension of the materialization by the SE Question
  • Waterfall – Timing sequence by the SE Queries
  • Question – The start of every SE Question

On this case, the primary SE Question returned 12’527’422 rows to the System engine (The variety of rows in the complete Truth desk) utilizing 1 GB of Reminiscence. This isn’t good, as massive materializations like these are efficiency killers.

This clearly signifies that we made an enormous mistake along with your DAX Code.

Lastly, we are able to learn the precise xmSQL Code:

Determine 11 – Storage  Engine Question Code (Determine by the Creator)

Right here we are able to see the xmSQL code and attempt to perceive the Drawback of the DAX Question.

On this case, we see that there’s a highlighted CallbackDataID. DAX Studio highlights all CallbackDataID within the Question textual content and makes all queries within the question record daring, which comprises a CallbackDataID.

We are able to see that, on this case, an IF() perform is pushed to the System Engine (FE), because the SE can not course of this perform. However SE is aware of that FE can do it. So, it calls the FE for every row within the outcome. On this case, over 12 million occasions.

As we are able to see from the timing, this takes loads of time.

Now we all know that we’ve written dangerous DAX Code and the SE calls the FE many occasions to execute a DAX perform. And we all know that we use 1 GB of RAM to execute the question.

Furthermore, we all know that the parallelism is just one.9 occasions, which might be significantly better.

What it ought to appear like

The DAX question comprises solely the Question created by Energy BI Desktop.

However typically, we want the Code of the Measure.

DAX Studio provides a function known as “Outline Measures” to get the DAX Code of the Measure:

  1. Add considered one of two clean traces within the Question
  2. Place the cursor on the primary (empty) line
  3. Discover the Measure within the Knowledge Mannequin
  4. Proper-click on the Measure and click on on Outline Measure
Determine 12 – Outline Measure in DAX Studio (Determine by the Creator)

5. If our Measure calls one other Measure, we are able to click on on Outline Dependent Measures. On this case, DAX Studio extracts the code of all Measures utilized by the chosen Measure

The result’s a DEFINE assertion adopted by a number of MEASURE Statements containing the DAX code of our responsible Measure.

After optimizing the code, I executed the brand new Question and took the Server Timings to match them to the unique Knowledge:

Determine 13 – Evaluating gradual a quick DAX code (Determine by the Creator)

Now, the complete question took solely 55 ms, and SE created a materialization of solely 19 Rows.

The parallelism is at 2.6 occasions, which is best than 1.9 occasions. It appears to be like just like the SE didn’t want that a lot processing energy to extend parallelism.

This can be a superb signal.

The optimization labored very effectively after taking a look at these numbers.

Conclusion

We’d like some info when we’ve a gradual Visible in your Energy BI Report.

Step one is to make use of Efficiency Analyzer in Energy BI Desktop to see the place time is spent rendering the results of the Visible.

Once we see that it takes a lot time to execute the DAX Question, we want DAX Studio to search out out the issue and attempt to repair it.

I didn’t cowl any strategies to optimize DAX on this article, because it wasn’t my purpose to do it.

However now that I’ve laid down the inspiration to get and perceive the efficiency metrics accessible in DAX Studio, I can write additional articles to indicate how you can optimize DAX code, what you must keep away from, and why.

I’m trying ahead to the journey with you.

Obtain DAX Studio without spending a dime right here: https://www.sqlbi.com/instruments/dax-studio/

Free SQLBI Instruments Coaching: DAX Instruments Video Course – SQLBI

SQLBI provides DAX-Optimization coaching as effectively.

I exploit the Contoso pattern dataset, like in my earlier articles. You may obtain the ContosoRetailDW Dataset without spending a dime from Microsoft right here.

The Contoso Knowledge will be freely used underneath the MIT License, as described right here.

Tags: DataDAXperformancePowerStudio

Related Posts

Image 109.png
Artificial Intelligence

Parquet File Format – All the pieces You Must Know!

May 14, 2025
Cover.png
Artificial Intelligence

Survival Evaluation When No One Dies: A Worth-Based mostly Strategy

May 14, 2025
Image 81.png
Artificial Intelligence

How I Lastly Understood MCP — and Bought It Working in Actual Life

May 13, 2025
Chatgpt Image May 10 2025 08 59 39 Am.png
Artificial Intelligence

Working Python Applications in Your Browser

May 12, 2025
Model Compression 2 1024x683.png
Artificial Intelligence

Mannequin Compression: Make Your Machine Studying Fashions Lighter and Sooner

May 12, 2025
Doppleware Ai Robot Facepalming Ar 169 V 6.1 Ffc36bad C0b8 41d7 Be9e 66484ca8c4f4 1 1.png
Artificial Intelligence

How To not Write an MCP Server

May 11, 2025
Next Post
01949112 D00f 723e Ba2f 95d470772800.jpeg

Alabama drops staking lawsuit towards Coinbase

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

POPULAR NEWS

Gemini 2.0 Fash Vs Gpt 4o.webp.webp

Gemini 2.0 Flash vs GPT 4o: Which is Higher?

January 19, 2025
0 3.png

College endowments be a part of crypto rush, boosting meme cash like Meme Index

February 10, 2025
How To Maintain Data Quality In The Supply Chain Feature.jpg

Find out how to Preserve Knowledge High quality within the Provide Chain

September 8, 2024
0khns0 Djocjfzxyr.jpeg

Constructing Data Graphs with LLM Graph Transformer | by Tomaz Bratanic | Nov, 2024

November 5, 2024
1vrlur6bbhf72bupq69n6rq.png

The Artwork of Chunking: Boosting AI Efficiency in RAG Architectures | by Han HELOIR, Ph.D. ☕️ | Aug, 2024

August 19, 2024

EDITOR'S PICK

Shutterstock 2051921990.jpg

Home windows Ugly Sweater winner of final yr is … • The Register

December 25, 2024
Image1 1024x576 1.png

Knowledge Science: From College to Work, Half III

March 28, 2025
1kfgceod Kewmwvyafviaq.jpeg

Omitted Variable Bias. An intro to an particularly sneaky bias… | by Sachin Date | Aug, 2024

August 6, 2024
Data Trust.jpg

Knowledge Lake Implementation: Finest Practices and Key Issues for Success

September 18, 2024

About Us

Welcome to News AI World, your go-to source for the latest in artificial intelligence news and developments. Our mission is to deliver comprehensive and insightful coverage of the rapidly evolving AI landscape, keeping you informed about breakthroughs, trends, and the transformative impact of AI technologies across industries.

Categories

  • Artificial Intelligence
  • ChatGPT
  • Crypto Coins
  • Data Science
  • Machine Learning

Recent Posts

  • Kraken completes latest Proof of Reserves, elevating the bar for crypto platform transparency
  • LangGraph Orchestrator Brokers: Streamlining AI Workflow Automation
  • Intel Xeon 6 CPUs make their title in AI, HPC • The Register
  • Home
  • About Us
  • Contact Us
  • Disclaimer
  • Privacy Policy

© 2024 Newsaiworld.com. All rights reserved.

No Result
View All Result
  • Home
  • Artificial Intelligence
  • ChatGPT
  • Data Science
  • Machine Learning
  • Crypto Coins
  • Contact Us

© 2024 Newsaiworld.com. All rights reserved.

Are you sure want to unlock this post?
Unlock left : 0
Are you sure want to cancel subscription?