Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
DJOXXXA
Helper I
Helper I

This week vs Last week problem

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:123.JPG

 

Here is the measure formula: 456.JPG

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!

1 ACCEPTED 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!

View solution in original post

2 REPLIES 2
v-xicai
Community Support
Community Support

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!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.