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.
Hello Power BI community
I need help to resolve a Year to Year comparison based on weekly performance.
The current code return does a fairly job to compare volumes from Last year Week 2 -2020 to this year Week2 - 2021.
However last year has 53 weeks, so the date range is different compared to this year.
I want to be able to compare last year Week 3 -2020 to this Year Week 2- 2021 (2.080.087 vs 1.396.933 , see screenshot) because this is more a correct range.
I was thinking wrapping the code around with the IF or Switch function and call +1 week if last year has 53 and compare the volumes with the current year.
This is the current code for Total volume_PY_weekly (not my code)
Thanks you
Solved! Go to Solution.
Hi @Anonymous ,
Please refer to my sample formula.
Value_PY_Weekly =
CALCULATE(
SUM('Table'[Value]),
FILTER(
ALLSELECTED('Table'),
[Year] = MAX([Year]) + 1 && [WeekNum] = MAX([WeekNum]) -1
)
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Please refer to my sample formula.
Value_PY_Weekly =
CALCULATE(
SUM('Table'[Value]),
FILTER(
ALLSELECTED('Table'),
[Year] = MAX([Year]) + 1 && [WeekNum] = MAX([WeekNum]) -1
)
)
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
throw your hands in the air and run away screaming if you want to keep your sanity.
Or add a column in your dates table that indicates exactly which last year's date should be compared to the current date.
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 |
---|---|
117 | |
104 | |
77 | |
73 | |
52 |
User | Count |
---|---|
145 | |
109 | |
109 | |
90 | |
64 |