cancel
Showing results for 
Search instead for 
Did you mean: 
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
Exciting changes

Power BI Community Changes

Check out the changes to the Power BI Community announced at Build.

May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Kudo Data Story carousel

Data Stories Gallery

Visit our Data Stories Gallery and give kudos to your favorite Data Stories.

Top Solution Authors