Forum Discussion
Follow up on Previous Year Measure Issue
- 1 year ago
Hi TotalAnonymous,
Thank you for reaching out to Microsoft Fabric Community.
Thank you for sharing the pbix file, based on your requirement please replace your Offtake Sales – YTD PY measure with this below measure
Offtake Sales – YTD PY =
VAR LatestWeekID_ThisYear =
CALCULATE(
MAX('Sample Data'[WeekID]),
'calendar_new'[Year] = YEAR(TODAY())
)
VAR TargetWeekNumber =
MOD(LatestWeekID_ThisYear, 100)
VAR TargetYear = YEAR(TODAY()) - 1
VAR MinWeekID = TargetYear * 100 + 1
VAR MaxWeekID = TargetYear * 100 + TargetWeekNumber
RETURN
CALCULATE(
SUM('Sample Data'[Sales Value]),
FILTER(
ALL('Sample Data'),
'Sample Data'[WeekID] >= MinWeekID &&
'Sample Data'[WeekID] <= MaxWeekID
)
)
This will return YTD value of previous year up to 202418
Attached pbix file for your reference
If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it!
Thanks and regards,
Anjan Kumar Chippa
Hi TotalAnonymous,
As we haven’t heard back from you, we wanted to kindly follow up to check if you have got any chance to test? Is the issue resolved?
If my response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Thanks and regards,
Anjan Kumar Chippa
Hi @TotalAnonymous,
We wanted to kindly follow up to check if you have got any chance to test? or Is the issue resolved?
If my response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.
Thanks and regards,
Anjan Kumar Chippa