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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.