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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

My window function is not working as expected

Hi Team,

I am using the below function to calculate next 2 weeks total for the current week.

I am using windown function it is working fine till the last 2 week but when it comes to week 51 and 52 it shows wrong value even though I have data for next year and but I am using the filter as year.

Evn though if I use year in filter my calculation should count for next week from next year.

Sales_Total_Window = CALCULATE(COALESCE([Sales_Total],0),
WINDOW(1,REL,2,REL,SUMMARIZE(ALLSELECTED('src_horizon v_horizon_aggregate'),'src_horizon v_horizon_aggregate'[YEAR],'src_horizon v_horizon_aggregate'[MONTH],'src_horizon v_horizon_aggregate'[Month_Number],'src_horizon v_horizon_aggregate'[WEEK],'src_horizon v_horizon_aggregate'[Week_Number]),ORDERBY('src_horizon v_horizon_aggregate'[YEAR],ASC,'src_horizon v_horizon_aggregate'[Month_Number],ASC)))/12
Raks_0-1688036628374.png

 

0 REPLIES 0

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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.

Top Solution Authors