Date.IsInPreviousNWeeks
This function assesses if the specified datetime value, dateTime, falls within the previous number of weeks based on the current date and time of the system. It should be noted that the function will ...
This function assesses if the specified datetime value, dateTime, falls within the previous number of weeks based on the current date and time of the system. It should be noted that the function will return false if the value provided falls within the current week.
Parameters:
- dateTime: A date, datetime, or datetimezone value for evaluation.
- weeks: Number of weeks to be considered.
Verify whether the week preceding the current system time falls within the past two weeks by utilizing Power Query function MDate.IsInPreviousNWeeks(). By subtracting 7 days from the current date and time using Date.AddDays(DateTime.FixedLocalNow(), -7), we can determine if this week is within the previous 2 weeks. The output will indicate if this condition is met, with "true" signifying that it is indeed within the previous two weeks.