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

Total sales of Last Year same week with Year Month and WeekNumber columns

Hi Team,

I have Year, Month and Week Number and Sales , I have to calculate last year sales of the same week.

YearMonthWeekSales
20221110
20221220
20221330
20221440
20221550
20231160
20231270
20231380
20231490
202325100

Result 

YearMonthWeekSalesResult 
20221110 
20221220 
20221330 
20221440 
20221550 
2023116010
2023127020
2023138030
2023149040
20232510050

 

Thanks in Advance !

 

1 ACCEPTED SOLUTION
Ahmedx
Super User
Super User
3 REPLIES 3
Ahmedx
Super User
Super User

Anonymous
Not applicable

@Ahmedx ,

I dont have any other table its just single table and no date column too, It has only Year,MonthNumber & WeekNumber.


Thanks!

Ahmedx
Super User
Super User

you must have a calendar table
if there is a calendar, then you can use

Measure = CALCULATE(SUM('Table'[Sales]) ,DATEADD(Calendar[Date],-1,YEAR))

to get the desired result

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.