Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

Power Query convert date to datetime

Hello guys,

 

The Power Query convert itself all my date (dd/mm/yyyy) columns to datetime (dd/mm/yyyyy 00:00:00).

I would like to keep it in the original type without needing to transform the type or redefine the format in the modelisation tab.

 

Thank you in advance !

1 ACCEPTED SOLUTION
HotChilli
Super User
Super User

So it looks like you have solved the issue which is probably that powerbi has automatic type detection switched on and it's made an assumption of datetime instead of date.  So it's not really a problem, more a nuance.

But you now seem to have edited the step and everything is good?

View solution in original post

3 REPLIES 3
HotChilli
Super User
Super User

So it looks like you have solved the issue which is probably that powerbi has automatic type detection switched on and it's made an assumption of datetime instead of date.  So it's not really a problem, more a nuance.

But you now seem to have edited the step and everything is good?

HotChilli
Super User
Super User

Can you post the Advanced Editor code here please?

Anonymous
Not applicable

Hi,

 

here below the code 

 

let
    Source = OData.Feed("ODATA FLUX LINK", null, [Implementation="2.0"]),
    #"Création CléAgrégée" = Table.AddColumn(Source, "CléAgrégée", each [CAMPAGNE]&[D_ORGA]&[D_CTRL]),
    #"Colonnes renommées" = Table.RenameColumns(#"Création CléAgrégée",{{"STATUT_INDICATEUR", "Statut indic."}}),
    #"Date extraite" = Table.TransformColumns(#"Colonnes renommées",{{"CREATE_TIME", DateTime.Date, type date}, {"FINISH_TIME", DateTime.Date, type date}, {"CLOSING_TIME", DateTime.Date, type date}, {"DATE_FROM", DateTime.Date, type date}, {"DATE_TO", DateTime.Date, type date}}),
    #"Type modifié" = Table.TransformColumnTypes(#"Date extraite",{{"DATE_HEURE_EXTRACTION", type datetime}})
in
    #"Type modifié"

I had to to transform columns to date in waiting 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors