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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

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
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.