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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
arunaramana
Helper III
Helper III

automatically CALCULATE() function is surrounded to a measure when it is inovked in a DAX expression

Hello There, 

I found the following information when going through the "Context Transition" documentation by "Alberto Ferrari /SQLBI".

Would anyone please help me understand?

 

It is worth remembering that when you invoke a measure from a DAX expression, this is automatically surrounded by CALCULATE. The automatic CALCULATE, added by DAX, performs context transition and it might become source of errors in your code.

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

When you start working with iterators it is important to remember to use CALCULATE in order to trigger context transition.  If you use a measure you don't need to include that.  Because the 3rd measure uses another measure in the iteration your don't need the CALCULATE around it to get the correct answer.

 

2021-10-24_15-31-53.jpg

View solution in original post

3 REPLIES 3
jdbuchanan71
Super User
Super User

When you start working with iterators it is important to remember to use CALCULATE in order to trigger context transition.  If you use a measure you don't need to include that.  Because the 3rd measure uses another measure in the iteration your don't need the CALCULATE around it to get the correct answer.

 

2021-10-24_15-31-53.jpg

Anonymous
Not applicable

Hi,

 

I am trying to better understand this concept. Why is the "Year" field shown in the table and not the "Year Month" field that is in the DAX expression? 

That was just to have fewer rows in the screen shot.  The amounts in the measure get aggregated up to the level of Year because that is the field on the rows.  It has nothing to do with the facth that when you are working with iterators you have to

a. Use and existing measure or

b. Use CALCULATE around your expression

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.

Top Solution Authors