Forum Discussion
Anonymous
4 years agoNot applicable
Calculating Previous Values
Hi, I am posting the same question again in hopes of finding the answer. I need to calculate the value for the past two weeks from Net Hire column. The dax measure I have is not giving me any va...
- Anonymous4 years ago
Would something like this serve? I am assuming that the source data has a [Fiscal Week Ends] column, not a hire date.
Last 2 Weeks New =
var currentweek = [Fiscal Week Num]var previousweek = [Fiscal Week Num]-1
var currentweekhires =
CALCULATE(
SUM(
'Terms & Hires SQL'[Net Hires]),
[Fiscal Week End]=currentweekvar previousweekhires =
CALCULATE(
SUM(
'Terms & Hires SQL'[Net Hires]),
[Fiscal Week End]=previousweekreturn
currentweekhires+previousweekhires
TheoC
4 years agoCommunity Champion
Anonymous try the below:
14 Days =
VAR_1 = LASTDATE ( 'Terms & Hires SQL'[Fiscal Week Ends] ) - 7
VAR_2 = _1 - 14
RETURN
CALCULATE ( SUM ('Terms & Hires SQL'[Net Hires] ) , FILTER ( ALL ( 'Terms & Hires SQL'[Fiscal Week Ends]) , AND ( 'Terms & Hires SQL'[Fiscal Week Ends] > _2 , 'Terms & Hires SQL'[Fiscal Week Ends] <= _1 ) ) )
Anonymous
4 years agoNot applicable
It was giving me errors so I modified it (bottom snip)