Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hello Everyone,
I have a huge dataset in a table "Raw" and I am looking create a new table which gives me the data from last 6 weeks and next 6 weeks from current day.
I did write the below code but I am just getting partial rows and not the entire output I am expecting. Can anyone suggest the most efficient approach for this problem.
Last 6 Weeks and Next 6 Weeks =
VAR CurrentDate = TODAY()
VAR MinDate = MIN(Raw_Salesforce[Close_Date])
VAR MaxDate = MAX(Raw_Salesforce[Close_Date])
RETURN
FILTER(
'Raw_Salesforce',
Raw_Salesforce[Close_Date] >= DATEADD(Raw_Salesforce[Close_Date], -42, DAY) &&
Raw_Salesforce[Close_Date] <= DATEADD(Raw_Salesforce[Close_Date], 42, DAY) &&
Raw_Salesforce[Close_Date] >= IF(CurrentDate > MaxDate, MaxDate, CurrentDate) - 42 &&
Raw_Salesforce[Close_Date] <= IF(CurrentDate < MinDate, MinDate, CurrentDate) + 42
)
Thanks in advance!
Cheers,
Praj
Solved! Go to Solution.
hi @Praj
try like:
hi @Praj
try like: