I am using power query in Excel. I have a date column with date starting in 1/31/2015 and ending 1/31/2022. I have the below line of code that works just fine.
...
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Reading", type number}, {"EM_Date", type date}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each [EM_Date] <= #date(2021, 12, 31)),
...
Now if I change the code just slightly like below It stops working and gives me an error. "Power Query Expression.Error: The Date value must contain the Date component. Details: 43831"
...
#"Changed Type" = Table.TransformColumnTypes(#"Renamed Columns",{{"Reading", type number}, {"EM_Date", type date}}),
#"Filtered Rows" = Table.SelectRows(#"Changed Type", each [EM_Date] >= #date(2021, 1, 31)),
...
How do I fix this error?
=DATE(2015,1,SEQUENCE(7*365+3,1,31))then loaded to PQ. I made the same filters as shown in your post and didn't get an error. Are you sure the error is happening because of that? Can you post the entire query?