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! Request now
Solved! Go to Solution.
Hi @alexpegg86
Please try the following measure:
Value Same Period Last Yearr =
VAR _select_year = SELECTEDVALUE('Total Soft Drinks Output'[Year])
VAR _select_period = SELECTEDVALUE('Total Soft Drinks Output'[Period])
RETURN
CALCULATE(
SUM('Total Soft Drinks Output'[Spend]),
FILTER(ALL('Total Soft Drinks Output'),'Total Soft Drinks Output'[Period] = _select_period && 'Total Soft Drinks Output'[Year] = _select_year-1)
)
Value Same Period Last two Years =
VAR _select_year = SELECTEDVALUE('Total Soft Drinks Output'[Year])
VAR _select_period = SELECTEDVALUE('Total Soft Drinks Output'[Period])
RETURN
CALCULATE(
SUM('Total Soft Drinks Output'[Spend]),
FILTER(ALL('Total Soft Drinks Output'),'Total Soft Drinks Output'[Period] = _select_period && 'Total Soft Drinks Output'[Year] = _select_year-2)
)
Result:
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @alexpegg86
Please try the following measure:
Value Same Period Last Yearr =
VAR _select_year = SELECTEDVALUE('Total Soft Drinks Output'[Year])
VAR _select_period = SELECTEDVALUE('Total Soft Drinks Output'[Period])
RETURN
CALCULATE(
SUM('Total Soft Drinks Output'[Spend]),
FILTER(ALL('Total Soft Drinks Output'),'Total Soft Drinks Output'[Period] = _select_period && 'Total Soft Drinks Output'[Year] = _select_year-1)
)
Value Same Period Last two Years =
VAR _select_year = SELECTEDVALUE('Total Soft Drinks Output'[Year])
VAR _select_period = SELECTEDVALUE('Total Soft Drinks Output'[Period])
RETURN
CALCULATE(
SUM('Total Soft Drinks Output'[Spend]),
FILTER(ALL('Total Soft Drinks Output'),'Total Soft Drinks Output'[Period] = _select_period && 'Total Soft Drinks Output'[Year] = _select_year-2)
)
Result:
Best Regards,
Jayleny
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks @Anonymous ! That has worked 😀
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 5 | |
| 5 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 12 | |
| 11 | |
| 10 |