Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Solved! Go to Solution.
Hi @Anonymous ,
Approve with @amitchandak , the variables are evaluated once in the code or calculation for each context. This means that the result of the measure won't change if we manipulate the filter context in the expression later in the code. Due to this reason, the result of
Here are the two measures:
Prior Month without var =
VAR Prior_month =
CALCULATE ( SUM('Table'[Value]), PARALLELPERIOD ('Date'[Date], -1, MONTH ) )
Return
Prior_month
Prior Month with var =
VAR this_month = SUM('Table'[Value])
VAR Prior_month =
CALCULATE ( this_month, PARALLELPERIOD ( 'Date'[Date], -1, MONTH ) )
Return Prior_month
Output:
Kind Regards,
Bubble
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Approve with @amitchandak , the variables are evaluated once in the code or calculation for each context. This means that the result of the measure won't change if we manipulate the filter context in the expression later in the code. Due to this reason, the result of
Here are the two measures:
Prior Month without var =
VAR Prior_month =
CALCULATE ( SUM('Table'[Value]), PARALLELPERIOD ('Date'[Date], -1, MONTH ) )
Return
Prior_month
Prior Month with var =
VAR this_month = SUM('Table'[Value])
VAR Prior_month =
CALCULATE ( this_month, PARALLELPERIOD ( 'Date'[Date], -1, MONTH ) )
Return Prior_month
Output:
Kind Regards,
Bubble
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.