Forum

Lesson 6.05 Remove ...
 
Notifications
Clear all

Lesson 6.05 Remove Column

4 Posts
2 Users
0 Reactions
156 Views
(@obedouwsinc-com)
Posts: 4
Active Member
Topic starter
 

After writing the M code I clicked the "Close & Load" and the "DateTime" column (in the Excel view now column G) changed to a decimal format.

I see that column G is formatted as "General" while columns H and I (column I now blank) are formatted as "Custom" [Date/Time].

Why would column G (and column I) keep the previous format and not update?

 
Posted : 13/06/2024 1:02 pm
(@mynda)
Posts: 4761
Member Admin
 

Hi Douglas,

Did you set the data type for the DateTime column in Power Query to DateTime?

Keep in mind that the date types in Power Query are not formats. The formats applied to cells in the Excel grid override most data types.

Mynda

 
Posted : 13/06/2024 9:25 pm
(@obedouwsinc-com)
Posts: 4
Active Member
Topic starter
 

I did not set the data type for the Date/Time column, it was already setup with the custom date/time format.

It is just disappointing the Power Query data types do not pass back to Excel when you 'Close and Load'. I guess I am trying to think of a reason why we would not want that to happen.

 
Posted : 14/06/2024 9:39 am
(@mynda)
Posts: 4761
Member Admin
 

I'm a bit confused. To clarify, did the Date/Time column in Power Query had the Date/Time data type set? If so, it should feed through to Excel as a date/time format unless the column in Excel has been overridden with a different number format.

 
Posted : 14/06/2024 8:10 pm
Share: