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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

SAMEPERIODLASTYEAR - working with week ending dates

I have a dataset that goes by week ending dates e.g. every sale made between 01/10/2018 - 07/10/2018 (dd-mm-yyyy) will have the date 07/10/2018 (last day of week 40 in 2018).

When I use SAMEPERIODLASTYEAR I obviously get results for 01/10/2017 - 07/10/2017 which is technically correct.

 

The issue with this is, the weeks in the range don't quite align to how I want to view LY.

See below image, the week ending date is highlighted in yellow for TY & LY. Week ending for LY means I essentially am comparing 28/09/2017 - 01/10/2017 (e.g. the prior week LY) against 01/10/2018 - 07/10/2018 (current week TY).

 

image.png

 

I would like to, ideally, determine which week majority of the LY date range sits in, then adjust the LY week/date-range accordingly.

e.g. in this scenario, 01/10/2018 - 07/10/2018 should look at 02/10/2017 - 08/10/2017 (or week ending 07/10/2018 is equivalent to week ending 08/10/2017 LY).

 

Please let me know if any of this is confusing and I can try and clarify it better.

 

2 REPLIES 2
v-yuta-msft
Community Support
Community Support

Hi jd009,

 

Have you solved your issue by now?

 

Regards,

Jimmy Tao

v-yuta-msft
Community Support
Community Support

Hi jd009,

 

"I would like to, ideally, determine which week majority of the LY date range sits in, then adjust the LY week/date-range accordingly."

 

<--- The logic is not so clear. Could you share some mock-up and show more details about you expected result and the current measure you are using?

 

Regards,

Jimmy Tao

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors