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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
WilliamKaro
Regular Visitor

Adding 4/13/52 weeks of data but start points needs to move

Hi there,

 

I have a set of data where I need to calculate value based on a set amount of days. 

 

In the case of 4 weeks data, I've done this calc

Value 4 w/e = CALCULATE(SUM('UK Pricing Data (Appended)'[Value]),DATESINPERIOD('UK Pricing Data (Appended)'[DATE W/E],MAX('UK Pricing Data (Appended)'[DATE W/E]),-28,DAY))
 
Now when i calculate the 4 w/e LAST YEAR data i performed this calculation:
Value 4 w/e -1 = CALCULATE([Value 4 w/e],SAMEPERIODLASTYEAR('UK Pricing Data (Appended)'[DATE W/E]))
 
The data starts at 18 May 2024 (-28 days) but the data last year needs to start on the 20th May 2023 and because of this, it calculates the dates from 13th May meaning it's not the right number to compare. 
 
WilliamKaro_1-1718719022591.png

Is there a DAX rule to look at last years numbers but 2 days ahead of same period last year? Do i need to create a custom table to arrange what is defined as 4/13/52 weeks?

 

Thanks!

 

 

 

3 REPLIES 3
lbendlin
Super User
Super User

Go with multiples of 7 days - 28/91/364  . Much easier, impervious to leap years, and more "like for like".

Hey there the challenge i face is that the data starts 2 days before . So for instance 20th May 2024 wont extract data from the 18th. The data is also on a weekly basis. If this is the case, surely the solution you mention wouldn't work?

As long as you have a calendar table in your data model and your fact table has a date associated with the week number this will still work.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.