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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
ronrsnfld
Super User
Super User

Default "Changed Type" in Excel

In Power Query for Excel, the default behavior for the automatically generated #"Changed Type" step on my system is to set columns with dates to type datetime if the data source is in the open Excel workbook. 

 

If the datasource is a saved Excel workbook, the same data will be set to type date in Excel.

 

Is there any method of changing this default behavior in Excel for a data source within the open Workbook?

(I am aware of how to change it manually; I would like to change the default behavior).

 

Data Source

ronrsnfld_0-1748789175022.png

 

Data > Get&Transform > From Table >

Automatically generated code from the above

let
    Source = Excel.CurrentWorkbook(){[Name="Table4"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Dates", type datetime}, {"DateTimes", type datetime}})
in
    #"Changed Type"

 

 

1 ACCEPTED SOLUTION

 

Yes you are right. Currently, Power Query automatically converts columns from Excel.CurrentWorkbook() to type datetime, even when the underlying data is a plain date. This is inconsistent with how external Excel file sources (Excel.Workbook(...)) behave, which correctly set columns to type date when appropriate. This behavior creates unnecessary cleanup work when working with tables in the current workbook. It would be incredibly helpful if users could globally configure the default data type mapping for date/datetime detection or choose to disable or override the Changed Type step defaults for Excel.CurrentWorkbook(). Please consider adding a setting (in Power Query or Excel Options) to control this behavior.

The final option:
There is no longer a dedicated Power Query UserVoice, but you can use Microsoft Excel Feedback Portal:
https://feedbackportal.microsoft.com/feedback

Go to Excel > Power Query, and click + Give feedback

 

If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.


Best Regards,
Nasif Azam

View solution in original post

4 REPLIES 4
Omid_Motamedise
Super User
Super User

Yes, you can handle this behavior by modifying the time part of the values in the "Changed Type" step. While there isn’t a built-in setting in Excel Power Query to change the default type detection behavior directly, you can programmatically adjust the results after the "Changed Type" step.

If you find that Power Query assigns a datetime type but the time part is always 00:00:00, you can convert those columns to date using a conditional step. For example:

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h
Nasif_Azam
Impactful Individual
Impactful Individual

Hey @ronrsnfld ,

You're absolutely right in your observation Power Query for Excel behaves differently depending on whether the source table comes from:

  1. an open Excel workbook via Excel.CurrentWorkbook()) have default Changed Type to datetime, even plain dates become datetime.
  2. a saved workbook file via Excel.Workbook(File.Contents(...))  have default Changed Type to date, even plain dates become date.

 

There is currently no built-in setting in Power Query or Excel to change this default behavior globally. However, you have some options:

1. Disable Auto Type Detection (Prevent the "Changed Type" Step)

  • Go to Power Query Editor
  • Click on File > Options and Settings > Query Options
  • Under Global > Data Load, uncheck

Automatically detect column types and headers for unstructured sources. While this stops auto-type detection for unstructured sources (like text/CSV), it does not affect Excel tables, which are considered structured. So this workaround has limited effect on open workbook sources.

2. Use a Template with a Custom "Changed Type" Step

let
    Source = Excel.CurrentWorkbook(){[Name="Table4"]}[Content],
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Dates", type date}, {"DateTimes", type datetime}})
in
    #"Changed Type"


3. Use M Code to Convert DateTime to Date Automatically
After the "Changed Type" step, insert a step to convert specific columns back to type date:

 

#"Converted Dates Column" = Table.TransformColumnTypes(#"Changed Type", {{"Dates", type date}})


You could use this as a reusable function or partial query step.

 

If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.


Best Regards,
Nasif Azam


@Nasif_Azam wrote:

There is currently no built-in setting in Power Query or Excel to change this default behavior globally.

 

Unfortunate. Yes, I am aware of all the various work-arounds, including writing my own type detection routines, but was hoping to avoid that. Do you happen to have the link where I can request to have this added as a feature?

 

Yes you are right. Currently, Power Query automatically converts columns from Excel.CurrentWorkbook() to type datetime, even when the underlying data is a plain date. This is inconsistent with how external Excel file sources (Excel.Workbook(...)) behave, which correctly set columns to type date when appropriate. This behavior creates unnecessary cleanup work when working with tables in the current workbook. It would be incredibly helpful if users could globally configure the default data type mapping for date/datetime detection or choose to disable or override the Changed Type step defaults for Excel.CurrentWorkbook(). Please consider adding a setting (in Power Query or Excel Options) to control this behavior.

The final option:
There is no longer a dedicated Power Query UserVoice, but you can use Microsoft Excel Feedback Portal:
https://feedbackportal.microsoft.com/feedback

Go to Excel > Power Query, and click + Give feedback

 

If you found this solution helpful, please consider accepting it and giving it a kudos (Like) it’s greatly appreciated and helps others find the solution more easily.


Best Regards,
Nasif Azam

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors