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 all,
I got a request to make a weekly report that compares This week vs Last week and This week vs Same week Last year.
I have found a video further explaining this topic: YT Video and I have made two measures called "Last week" and "Same week last year" and I have gotten the results I needed, except for the measure "Last week" when the current week is the first week of the year. I know that the linked video shows this, and in the video this works perfectly, but for some strange reason, my measure doesnt work as it is supposed to:
Here is the measure formula:
What I think is happening for me is - MAX for the Week Number is 53 (since some years have 53 weeks) and then, when the previous years have 52 weeks (which is more usual), this causes measure to return blank value.
Does anybody have a solution for this problem?
Thank you all in advance!
Solved! Go to Solution.
Hi Amy,
I did what you wrote, but for some reason it still doesn't work (and by looking at your formula it should). Anyway, I found a less elegant solution, and that was to make additional helper columns in my calendar table and now it works.
Thank you for your effort.
Kind regards!
Hi @DJOXXXA ,
You can try to change this part of formula "Table1[Week]=MaxWeekNumber &&Table1[Flash Year] =CurrentYear-1" to code "Table1[Week]=CALCULATE(MaxWeekNumber, FILTER(ALL(Table1),Table1[Flash Year] =CurrentYear-1)) &&Table1[Flash Year] =CurrentYear-1" .
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Amy,
I did what you wrote, but for some reason it still doesn't work (and by looking at your formula it should). Anyway, I found a less elegant solution, and that was to make additional helper columns in my calendar table and now it works.
Thank you for your effort.
Kind regards!
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 |
---|---|
109 | |
98 | |
77 | |
66 | |
54 |
User | Count |
---|---|
144 | |
104 | |
100 | |
86 | |
64 |