March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi All,
I'm trying to fix up a report that stopped working for whatever reason, I do not have much experience with power query and am stuck. The problem is I get the error below when trying to transform the column into a date.
Here is the code where the error occurs.
in
Source,
#"Extracted Date" = Table.TransformColumns(CMSales,{{"CREATED_DATE", DateTime.Date, type date}}),
#"Filtered Rows" = Table.SelectRows(#"Extracted Date", each ([STATUS] <> "CANCELLED")),
CREATED_DATE = #"Filtered Rows"{0}[CREATED_DATE]
Any advice appreciated.
Solved! Go to Solution.
Hi @sperry19 ,
Try to split the conversion into two steps.
#"Changed Type" = Table.TransformColumnTypes(CMSales,{{"CREATED_DATE", type datetime}}),
#"Changed Type1" = Table.TransformColumnTypes(#"Changed Type",{{"CREATED_DATE", type date}})
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Hi @sperry19 ,
Try to split the conversion into two steps.
#"Changed Type" = Table.TransformColumnTypes(CMSales,{{"CREATED_DATE", type datetime}}),
#"Changed Type1" = Table.TransformColumnTypes(#"Changed Type",{{"CREATED_DATE", type date}})
Best Regards,
Gao
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Depending on what your data really is like, something like the code below might work:
Table.TransformColumns(CMSales, {"CREATED_DATE", each DateTime.Date(DateTime.From(_)), type date})
Try using Date.From instead of DateTime.Date.
--Nate
Hey Thanks for the suggestion. Unfortunatly this did not work. the original data type is datetime2(7) in the database. Should I be using some function to trim the last digits so it is returned as YYYY-MM-DD hh:mm:ss?
how does the source data look like? Are the links in place?
Sorry not sure what you mean by links, the original data source type is datetime2(7)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
16 | |
13 | |
13 | |
9 |
User | Count |
---|---|
36 | |
31 | |
20 | |
19 | |
17 |