Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Filter dates before current week

Hello,

I have the following table in Power Query and i am trying to filter all rows based on the Start date before the Monday date of the current week. Is this possible? Any help is much appreciated!

 

Start dateStockReturnsDefectiveCategory
01/05/20216917Late
27/05/20222510On time
07/08/20225615On time
14/07/20225615Undefined
08/08/2022348No action
12/08/20222210Late
17/08/20227822On time
20/08/20223313No action
22/08/20226318Late
29/08/20223314On time
18/09/20223314Undefined
07/09/20222717No action
16/09/20223722On time
20/09/20229316On time
23/09/20227520Late
11/10/20229818No action
04/01/20236716On time
17/02/202371434On time
11/12/20229818No action
  • Hi Anonymous ,

     

    Try this:

    Table.SelectRows(
        previousStepName,
        each [Start date] < Date.StartOfWeek(Date.From(DateTime.LocalNow()), Day.Monday)
    )

     

    Pete

2 Replies

  • Hi Anonymous ,

     

    Try this:

    Table.SelectRows(
        previousStepName,
        each [Start date] < Date.StartOfWeek(Date.From(DateTime.LocalNow()), Day.Monday)
    )

     

    Pete

  • wdx223_Daniel's avatar
    wdx223_Daniel
    Community Champion

    =Table.SelectRows(PreviousStepName,each [Start date]<Date.StartOfWeek(Date.From(DateTime.LocalNow()),Day.Monday))