Forum Discussion

rajulshah's avatar
rajulshah
Icon for Resident Rockstar rankResident Rockstar
6 years ago
Solved

When is expression in VAR calculated?

Hello everyone,

I want to know that does the variables are already calculated before RETURN statement?

For example:

Measure = 
VAR A = SUM(Table[ColumnA])
VAR B = SUM(Table[ColumnB])
RETURN 
IF(TODAY()=DATE(2020,07,11),A,B)

So, in the measure above,
will both the variables A & B be calculated and then the RETURN statement is executed? 
OR 
It would first check the condition and then calculate A or B according to the condition?

I have checked out multiple videos & blogs, but it doesn't answer my question.

Any help is appreciated.
Thanks.

3 Replies