Forum Discussion
the date operation failed because the resulting value falls outside the range of allowed values
Your problem is here:
Date.Month(Date.From("2024/01/01"))-2
If the month is January, the month number is 1. 1-2 = -1 and -1 is not a valid month argument for #date(y,m,d).
You can correct this using Number.Mod.
But your logic makes no sense to me either. It looks like you are testing for [Name] >= "2024/11/01" and [Name] <= "2024/01/01" which will always return nothing.
Possibly you mean [Name] >= "2023/11/01" in which case you can create that date using Date.AddMonths
Perhaps, (and I show using two ways of defining a date -- use either)
[Name]>= Date.AddMonths(#date(2024,1,1),-2) and [Name]<=Date.From("2024/01/01"))
thanks for your reply.
let me explain the whole picture.
my user share lots of excel file in sharepoint, the file name format like ' ****************_YYYYMMDD.xlsx'
I need to consolidate the last 3 month's.
for example,
For January, include October, November and December 's file.
For Febuary, include November ,December and January 's file. thanks!