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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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
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.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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