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
Anonymous
Not applicable

WEEKNUM in date table, SAMEPERIODLASTYEAR giving the wrong answer (off by by a few)

I am trying to find the net difference between previous years data based on a period using a slicer.  The slicer uses the WEEKNUM column from my Calendar table.  I have a measure that gives me a rate from my Data table. I created another measure to give me the rate for the previous year using:

 

PrevRate = CALCULATE([CurRate], SAMEPERIODLASTYEAR('calendar'[Date])

 

In the visual I am getting weird results

 

Weeks 1 to 39:

 

YearCurRatePrevRate
2017312.16 
2018295.82314
2019 298

 

Weeks  5 to 36:

 

YearCurRatePrevRate
2017293.99 
2018274.58294
2019 282

 

It's weird because the rates are sometimes very similar, but can be off by a lot as well. When I change the slicer to use the Month column the results match exactly.

4 REPLIES 4
v-yuta-msft
Community Support
Community Support

Hi jgoddard,

 

Are the date continuous? You may try PREVIOUSYEAR instead if the date value is not continuous. If this issue persists, please share some sample data or share some screenshot of your raw data and do mask the sensitive data.

 

Regards,

Jimmy Tao

Anonymous
Not applicable

The dates are continuous, however not necessarily YTD.  Some times we need to compare from Week 21, and sometimes from Week 16 to current.

Anonymous
Not applicable

It also does not sum properly when using the Date column (range is changed daily).

Hi jgoddard,

 

Could you please share some sample data?

 

Regards,

Jimmy Tao

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.