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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
TimmK
Helper IV
Helper IV

What is the Difference Between MEASURE and VAR?

What is the difference between a query MEASURE and VAR? I read the definitions, but I do not fully understand the difference between these two used in DAX queries. Attention, I do not mean measures in general, but the function MEASURE within a DAX query in combination with DEFINE and EVALUATE as seen in the code example below.

 

MEASURE – DAX Guide 

VAR – DAX Guide

 

DEFINE

    MEASURE Sales[Sales Amount] = SUMX ( Sales, Sales[Quantity] * Sales[Net Price] )

    MEASURE Sales[Total Cost] = SUMX ( Sales, Sales[Quantity] * Sales[Unit Cost] )

    MEASURE Sales[Margin] = [Sales Amount] - [Total Cost]

EVALUATE

SUMMARIZECOLUMNS (

    Customer[CountryRegion],

    "Sales Amount", [Sales Amount],

    "Margin", [Margin]

 

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @TimmK 

 

In Power BI, measures are defined calculations on your data that are performed at the time of your query.

https://docs.microsoft.com/en-us/learn/modules/model-data-power-bi/4b-create-calculated-measures 

https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-measures 

 

At the most basic level, a DAX query is an EVALUATE statement containing a table expression. However, a query can contain multiple EVALUATE statements.

 

The optional DEFINE keyword defines entities that exist only for the duration of the query. Definitions are valid for all EVALUATE statements. Entities can be variables, measures, tables, and columns. Definitions can reference other definitions that appear before or after the current definition. Definitions typically precede the EVALUATE statement.

https://docs.microsoft.com/en-us/dax/dax-queries 

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

2 REPLIES 2
v-zhangti
Community Support
Community Support

Hi, @TimmK 

 

In Power BI, measures are defined calculations on your data that are performed at the time of your query.

https://docs.microsoft.com/en-us/learn/modules/model-data-power-bi/4b-create-calculated-measures 

https://docs.microsoft.com/en-us/power-bi/transform-model/desktop-measures 

 

At the most basic level, a DAX query is an EVALUATE statement containing a table expression. However, a query can contain multiple EVALUATE statements.

 

The optional DEFINE keyword defines entities that exist only for the duration of the query. Definitions are valid for all EVALUATE statements. Entities can be variables, measures, tables, and columns. Definitions can reference other definitions that appear before or after the current definition. Definitions typically precede the EVALUATE statement.

https://docs.microsoft.com/en-us/dax/dax-queries 

 

Best Regards,

Community Support Team _Charlotte

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

vapid128
Solution Specialist
Solution Specialist

MEASURE is a function. It is nothing before you call the  function.

VAR is a variable, such as int, double, array.... 

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.