Forum Discussion

rbalza's avatar
rbalza
Icon for Helper III rankHelper III
5 years ago
Solved

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. 

 


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] )

 

  • This one works :O)

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

     

1 Reply

  • This one works :O)

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