cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rbalza
Helper III
Helper III

Calculating Previous Week & 2 Weeks prior using Data using Slicer

Hi Everyone,

 

Need the help of calculating the previous week's total number of hours compared to the current week when using a slicer filter.
I am using the weekending slicer which is based on the fact table. 

rbalza_2-1623392130867.png

 

rbalza_0-1623391867926.png
Here's my measure.

Total Hours Previous Week = 
   CALCULATE( [Total Hours Worked],
   DATESINPERIOD( 'Fact Pay Detailed Report'[Timesheet], MAX( 'Fact Pay Detailed Report'[Timesheet] ), -7, DAY ))
Total Hours Worked = SUM( 'Fact Pay Detailed Report'[Total Hours] )

rbalza_1-1623392085758.png

 

1 ACCEPTED SOLUTION
rbalza
Helper III
Helper III

This one works :O)

Total Hours Previous Week = 
   CALCULATE( [Total Hours Worked],
   DATEADD('Fact Pay Detailed Report'[Timesheet],-7,DAY))

 

View solution in original post

1 REPLY 1
rbalza
Helper III
Helper III

This one works :O)

Total Hours Previous Week = 
   CALCULATE( [Total Hours Worked],
   DATEADD('Fact Pay Detailed Report'[Timesheet],-7,DAY))

 

View solution in original post

Helpful resources

Announcements
MBAS on Demand

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

July 2021 Update 768x460.png

Check it out!

Click here to read more about the July 2021 Updates

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Urdu Hindi D365 Bootcamp 768x460.png

Urdu Hindi D365 Bootcamp

Dont miss our very own April Dunnam’s The Developer Guide to the Galaxy! Find out what the Power Platform has to offer for the traditional developer.

Top Solution Authors