Forum Discussion
Fixed Date, Dynamic Year - Date Filtering Woes
- 6 years ago
Anonymous - Try ditching your Date.From, I don't see why you need that. Also, you need () on your .LocalNow
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each [Date] >= Date.AddMonths(Date.StartOfYear(DateTime.LocalNow())),-9)
Anonymous - Try ditching your Date.From, I don't see why you need that. Also, you need () on your .LocalNow
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each [Date] >= Date.AddMonths(Date.StartOfYear(DateTime.LocalNow())),-9)
Thanks, Greg_Deckler - I always struggle with the date/datetime/datetimezone fields!
I've tried what you have suggested but now get: -
Expression.Error: 3 arguments were passed to a function which expects 2.
Details:
Pattern=
Arguments=[List]
Then I realised there were not enough brackets (or not in the right place) and get: -
Expression.Error: We cannot apply operator < to types DateTime and Date.
Details:
Operator=<
Left=01/10/2019 00:00:00
Right=21/08/2019
- Anonymous6 years agoNot applicable
Ah I may have cracked it...
#"Filtered Rows" = Table.SelectRows(#"Added Conditional Column1", each [Date] >= Date.From(Date.AddMonths(Date.StartOfYear(DateTime.LocalNow()),-9)))
Converting datetime to date with the Date.From - then matches the "Date" format in [Date]