Shane S
Shane S

Reputation: 2293

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?

Upvotes: 0

Views: 5776

Answers (1)

Shane S
Shane S

Reputation: 2293

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!

Upvotes: 1

Related Questions