Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Uniqueusername
Helper III
Helper III

DAX engine under the hood- dax measure vs dax query terminology

Hi,

 

I have been exploring DAX Studio to gain a better understanding of what happens under the hood in a Power BI report. I'm curious about why an SQL query is generated when a DAX formula is executed.

 

Additionally, I've encountered the terms "DAX Formula" and "DAX Query" being used interchangeably in some resources, while in others, there seems to be a distinction between them. Please correct me if I'm mistaken. As far as I understand it, a "DAX formula" is what you write as a measure. In other words, "DAX Formula = DAX Measure."

 

On the other hand, a "DAX Query" is what generates the DAX formula. Are these the "Evaluate" and "Define" keywords we see in DAX Studio?

 

Also, why is there an SQL query generated with every DAX measure (or is "DAX Query" the correct term) ?

1 ACCEPTED SOLUTION

Eventually, yes.  It will return a table (or multiple tables) to the renderer, indicating which values should go where (especially if row or column totals are involved).

 

This means for you as a visual designer that you want to be frugal with the number of fields you put into a visual.  It might be tempting to load up the tootips aea (for example) but that all adds to the query cost.

View solution in original post

6 REPLIES 6
Uniqueusername
Helper III
Helper III

Here is a sample data I created using the EnterData feature in power bi and a simple sum measure

Measure = SUM ( 'Table'[Value])

 

Uniqueusername_1-1711163719453.png

 

Looking into DAX studio this is what I get

Uniqueusername_2-1711163846736.png

So it does look like there is an SQL query running in the back ground. I haven't used any power query transformations in this nor is it Direct query

 

I thought query folding kicks in only when the datasource is some sort of a database such as an SQL server

Ah, ok, you are looking at the VertiPaq queries. Yes, the DAX queries are internally translated into SQL-like queries against the SSAS Tabular storage. But these are purely internal and not something you can write directly.

thank you. And what about the code that DAX Studio generates ? That is the query which creates the visual ?

Eventually, yes.  It will return a table (or multiple tables) to the renderer, indicating which values should go where (especially if row or column totals are involved).

 

This means for you as a visual designer that you want to be frugal with the number of fields you put into a visual.  It might be tempting to load up the tootips aea (for example) but that all adds to the query cost.

thank you. That clears things up. I am sure I will have more questions as I dive deeper into DAX studio. Until then, I will mark this as solved

lbendlin
Super User
Super User

I'm curious about why an SQL query is generated when a DAX formula is executed.

 

Read about Query Folding

 

As far as I understand it, a "DAX formula" is what you write as a measure. In other words, "DAX Formula = DAX Measure."

That is incorrect.  A DAX formula in the vast majority of cases returns a table. A measure can only return a scalar value.

Also, why is there an SQL query generated with every DAX measure (or is "DAX Query" the correct term) ?

Not with every query.  Only with Direct Query and Query folding.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.