Forum Discussion
Filter rows in query editor up to current date
- Anonymous10 years ago
Short of typing in all the code in the advanced editor yourself...
Hit the filter dropdown on the column and go to Date Filters, pick "Before...", then in the input box that pops up change that to "is before or equal to..." Type in today's date or whatever arbitrary date (this is just to get the editor to give you the code. You'll change this in a moment so the date doesn't really matter) and hit enter.
Now go to the formula bar. You should see something that looks like:
= Table.SelectRows(#"Replaced Value", each [startdate] <= #date(2016, 5, 9))
Replace the date part of that with Date.From(DateTime.LocalNow())
= Table.SelectRows(#"Replaced Value", each [startdate] <= Date.From(DateTime.LocalNow()))
Now your query will always be filtered to the current day or earlier.
Short of typing in all the code in the advanced editor yourself...
Hit the filter dropdown on the column and go to Date Filters, pick "Before...", then in the input box that pops up change that to "is before or equal to..." Type in today's date or whatever arbitrary date (this is just to get the editor to give you the code. You'll change this in a moment so the date doesn't really matter) and hit enter.
Now go to the formula bar. You should see something that looks like:
= Table.SelectRows(#"Replaced Value", each [startdate] <= #date(2016, 5, 9))
Replace the date part of that with Date.From(DateTime.LocalNow())
= Table.SelectRows(#"Replaced Value", each [startdate] <= Date.From(DateTime.LocalNow()))
Now your query will always be filtered to the current day or earlier.
- Mark_Timson6 years agoHelper I
You Sir are a hero among men. This worked for me I was doing a filter in the Query to get data for each date >= TodaysDate
- gvg8 years agoPost Prodigy
Replace the date part of that with Date.From(DateTime.LocalNow())
= Table.SelectRows(#"Replaced Value", each [startdate] <= Date.From(DateTime.LocalNow()))
Now your query will always be filtered to the current day or earlier.
To the current day and time, to be precise.