JackDanIce
Well-known Member
- Joined
- Feb 3, 2010
- Messages
- 9,922
- Office Version
- 365
- Platform
- Windows
Hi,
I import a table of data into PQ with a column of dates.
I wish to filter this column for dates greater than or equal to the Monday of the current week
In Excel this would be:
At the moment I'm generating the week number in the data and using PQ to filter as:
I can either generate this Monday date in an Excel function then pass this to PQ to filter the date column with OR use a standalone function to calculate this date and then filter the data column.
Preference would be to do this all in PQ and drop the [WeekNum] column from the data. I've tried to create this function but it doesn't work:
Can anyone help?
TIA,
Jack
I import a table of data into PQ with a column of dates.
I wish to filter this column for dates greater than or equal to the Monday of the current week
In Excel this would be:
Excel Formula:
=TODAY()-WEEKDAY(TODAY(),2)
At the moment I'm generating the week number in the data and using PQ to filter as:
Power Query:
= Table.SelectRows(#"Changed Type", each [WeekNum] = List.Max(#"Changed Type"[WeekNum]))
I can either generate this Monday date in an Excel function then pass this to PQ to filter the date column with OR use a standalone function to calculate this date and then filter the data column.
Preference would be to do this all in PQ and drop the [WeekNum] column from the data. I've tried to create this function but it doesn't work:
Power Query:
= () => Date.StartOfWeek(DateTime.LocalNow)
Can anyone help?
TIA,
Jack