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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Raks
Helper III
Helper III

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

Raks
Helper III
Helper III

@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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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