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

Be 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

Reply
ahmed_MEJRI
Helper I
Helper I

Datetime column in SQL Server not displayed the same type in Power BI

Hi Experts, i have column named date in my sql server table. When i loaded data on PowerBI it's shown on 2 columns (date and hour) . I need to save the same format datetime.

these screenshoots of my date column in SQL Server and destination (powerBI)

ahmed_MEJRI_0-1598965477807.pngahmed_MEJRI_1-1598965508206.png ahmed_MEJRI_3-1598965554560.png

 

 

1 ACCEPTED SOLUTION

Hi @ahmed_MEJRI ,

 

In query editor, select both of these columns, right click and MERGE.

This will merge both of these columns.

Then click on the merged column and chnage it's datatype to datetime format from the top ribbon under TRANSFORM.

 

Consider following example:

Pragati11_0-1598976171455.png

 

Select both of your columns Date and Time:

Pragati11_1-1598976236319.png

Right click and select MERGE as highlighted above.

 

A window appears, enter the following values:

Pragati11_2-1598976288740.png

 

Once you hit OK, you get the following:

Pragati11_3-1598976315843.png

 

Select your merged column - DateTime Value

Then click on Transform on top ribbon and modify datatype to DATETIME as shown below:

Pragati11_4-1598976393399.png

 

You get your merged Datetime column as shown:

Pragati11_5-1598976426610.png

 

 

Hope this helps.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

View solution in original post

5 REPLIES 5
v-shex-msft
Community Support
Community Support

HI @ahmed_MEJRI,

What type of connector are you worked? AFAIK, power in desktop not auto split your datetime value except they are saved as specific timestamp format.

In addition, you can also take a look at the following blog about handling different date timezone values:

Handling Different Time Zones in Power BI / Power Query 
Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@ahmed_MEJRI , this can not happen automatically as far as I know. Open  Transform data mode and check if there is a step that split this column into two.

 

Also, change the data type of date column to DateTime.  and choose a format where time is visible. and check do see any time other than 12:00:00 AM

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Hi Experts,

in my model i have two columns called : Date and Heure (it's hour in french)

can we create a calculated column with DAX to make concat for the 2 columns Date and Heure to have the completed datetime and we call this column DatetimeFX for example ?

 

Best Regards

Hi @ahmed_MEJRI ,

 

In query editor, select both of these columns, right click and MERGE.

This will merge both of these columns.

Then click on the merged column and chnage it's datatype to datetime format from the top ribbon under TRANSFORM.

 

Consider following example:

Pragati11_0-1598976171455.png

 

Select both of your columns Date and Time:

Pragati11_1-1598976236319.png

Right click and select MERGE as highlighted above.

 

A window appears, enter the following values:

Pragati11_2-1598976288740.png

 

Once you hit OK, you get the following:

Pragati11_3-1598976315843.png

 

Select your merged column - DateTime Value

Then click on Transform on top ribbon and modify datatype to DATETIME as shown below:

Pragati11_4-1598976393399.png

 

You get your merged Datetime column as shown:

Pragati11_5-1598976426610.png

 

 

Hope this helps.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Pragati11
Super User
Super User

Hi @ahmed_MEJRI ,

 

Based on the shared screesnhots, it looks like there are some query steps in Power BI's query editor, which is splitting your Datetime column to a Date column and an Hour column.

 

Please check things in Power BI's query editor. This is surely happening there.

 

Thanks,

Pragati

Best Regards,

Pragati Jain


MVP logo


LinkedIn | Twitter | Blog YouTube 

Did I answer your question? Mark my post as a solution! This will help others on the forum!

Appreciate your Kudos!!

Proud to be a Super User!!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.