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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors