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
HALEYSTODDARD
Frequent Visitor

SAME WEEK/DAY NAME for last year vs. this year

Hi all! I'm trying to come up with a measure that would sum the hours worked on this day last year and compare it to this year. It needs to be a day of week comparison because our hours worked vary based on day of week volume fluctuations. For example, Monday's are higher that Friday's. 
 
Initially I tried
 
 
Total LY = CALCULATE(SUM('Kronos Detail'[Hours]),SAMEPERIODLASTYEAR(Dates[DATE]))
 
but I can't do it on the specific date, since this day last year was 3/23/22 vs. 3/22/23. I need it to be where week #/day name for 2022 = week/day name for 2023.
 
Does anyone have any tips/tricks on achieving this?
1 ACCEPTED SOLUTION
HALEYSTODDARD
Frequent Visitor

I ended up solving this myself with two measures. 

 

1st  = CALCULATE(SUM('Kronos Detail'[Hours]),DATEADD(Dates[DATE],-1,YEAR))
2nd = CALCULATE([1st],DATEADD(Dates[DATE],+1,DAY))

View solution in original post

1 REPLY 1
HALEYSTODDARD
Frequent Visitor

I ended up solving this myself with two measures. 

 

1st  = CALCULATE(SUM('Kronos Detail'[Hours]),DATEADD(Dates[DATE],-1,YEAR))
2nd = CALCULATE([1st],DATEADD(Dates[DATE],+1,DAY))

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.

Top Solution Authors