Forum Discussion

Jiji0129's avatar
Jiji0129
New Member
3 years ago

Selected date returns data + future + 12 weeks

Hi guys, could you please help me with this scenario? I got a table below which I created a calculated columns that is returning current week + future 12 weeks. It is working fine. However, I would like to add a date filter, this time want to see the same logic if I select previous date. Say if I select January 1, 2023, it will show me Jan 1 + future 12 weeks data.

 


Could you please confirm if this is possible? This is my current measure which is not showing progress at all.
Test =
VAR ReferenceDate = SELECTEDVALUE('Date'[Date])
VAR PreviousDates =
DATESINPERIOD(
'Date'[Date], ReferenceDate,3,MONTH)
VAR _Weeknum =
WEEKNUM( 'Date', 1 )
VAR _Weeknumtoday =
WEEKNUM( TODAY(), 1 )
VAR Week_Filter = SELECTEDVALUE('Date'[Start of Week])
VAR _Weeks =
CALCULATE(
Weeknum >= Weeknumtoday
&& Weeknum <= Weeknumtoday + 12)
VAR Test =
CALCULATE([Incomings], FILTER('Date','Date'[Date] >= _Weeks && 'Date'[Date] <= ReferenceDate))
RETURN
_Weeks

1 Reply