简体   繁体   中英

Power Query Expression.Error: The Date value must contain the Date component. Details: 43831

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?

For those that are coming to this post for answers. What I found is that the Column must be set to Dates. In my case I was calculating dates and the source column was not set as dates.

Hope this helps you!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM