The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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 😀
User | Count |
---|---|
15 | |
12 | |
8 | |
7 | |
7 |
User | Count |
---|---|
24 | |
21 | |
12 | |
10 | |
7 |