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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors