Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I have the following measures and I need a new measure called Net that is CurrentYear - PriorYear. Can I create this measure without repeating the formulas of the prior two...something like [CurrentYear] - [PriorYear] or something? All three of these will be used in a matrix with values over 12 months. Thanks.
CurrentYear = Format(
CALCULATE(sum(Sheet1[FinancialAmount]), filter(Sheet1, Sheet1[FinancialType]= "Current")),
"$#,##0;($#,##0)"
)
PriorYear = Format(
CALCULATE(sum(Sheet1[FinancialAmount]), filter(Sheet1, Sheet1[FinancialType]= "Prior")),
"$#,##0;($#,##0)"
)
Solved! Go to Solution.
Hi @admiralman,
Try to do VARIABLES within measures like below:
% YoY Sales =
VAR CURRENT_SALES = SUM(SALES)
VAR PRIOR_SALES = CALCULATE(SUM(SALES);SAMEPERIODLASTYEAR(DATES))
Return
DIVIDE ( CURRENT_SALES - PRIOR_SALES; PRIOR_SALES)
Best regards,
Hi @admiralman,
Try to do VARIABLES within measures like below:
% YoY Sales =
VAR CURRENT_SALES = SUM(SALES)
VAR PRIOR_SALES = CALCULATE(SUM(SALES);SAMEPERIODLASTYEAR(DATES))
Return
DIVIDE ( CURRENT_SALES - PRIOR_SALES; PRIOR_SALES)
Best regards,
Hi @admiralman,
Once you have created measures you can use them inside others measures. Also you can change the context of them.
Thanks,
Ricardo
Thanks...I came in today and looked at my question. I think I was trying to do something a little more complicated and didnt address the question correctly. I know you can do that with measures...must have had a brain f@rt. Thanks.
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.