Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
I need to set up calculations for the chosen period (last 13 weeks, last 26 weeeks, last 52 weeks) for the Current year and the same period for the previous year. Please note, that the period includes only full weeks, e.g. if today it is October, 7 2021, my "last 13 weeks period" for current year is from October ,1 2021 - July 5, 2021. Invoice Date in my data set start with the last day of my current period, that is October, 1 2021.
I an trying to set it up using day granulatrity, since there's no week calculation (as far as I know).
The formula below works well for the current year:
CY =
Would really appreciate some help on setting it up for the same priod in previous year. For reference, my expected period for the last 13 weeks for previous year is: October, 2 2020 to July, 6 2020.
Thank you so much in advance!
Solved! Go to Solution.
Thanks, @AlexisOlson! The year has shifted to 2020, however, it took the whole October in 2020. What I needed was to shift today 1 year back, then start with the full week, before the "current date LY".
I have tested doing separate calculation for the current date LY, start and end date and a calculation that calculates the chosen period for the previous year. It works fine. Publish my formulas below, in case someone else is looking for a similar solution.
Hi,
Sorry if it sounds silly, but did you try SAMEPERIODLASTYEAR ? or PARALLELPERIOD ?
Let us know...
Try shifting your dates argument back a year.
DATEADD ( DATESINPERIOD ( 'Date'[Date], _start, - period, DAY ), -1, YEAR )
Thanks, @AlexisOlson! The year has shifted to 2020, however, it took the whole October in 2020. What I needed was to shift today 1 year back, then start with the full week, before the "current date LY".
I have tested doing separate calculation for the current date LY, start and end date and a calculation that calculates the chosen period for the previous year. It works fine. Publish my formulas below, in case someone else is looking for a similar solution.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
100 | |
75 | |
73 | |
49 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |