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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
ty_34
New Member

I got a problem in power bi where my dates in the csv file is changed when I imported the csv file i

I got a problem in power bi where my dates in the csv file is changed when I imported the csv file into power bi

Screenshot (287).pngScreenshot (288).png

1 ACCEPTED SOLUTION
v-kongfanf-msft
Community Support
Community Support

Hi @ty_34 ,

 

The reason for this problem is that if a flat file is imported into powerbi, it follows the default date format in the control panel.

vkongfanfmsft_0-1707374152290.png

vkongfanfmsft_1-1707374269045.png

vkongfanfmsft_2-1707374330383.png

 

Then, you can change Date type like blew code in Power query or change it directly in Control Panel->region.

= Table.AddColumn(#"Changed Type", "Year", each Date.Year([#"Date (YYYY-MM-DD)"]), Int64.Type)

 

For more details, you can refer to below blog:

Power Query date format (How to + 5 tricky scenarios) (exceloffthegrid.com)

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

View solution in original post

2 REPLIES 2
v-kongfanf-msft
Community Support
Community Support

Hi @ty_34 ,

 

The reason for this problem is that if a flat file is imported into powerbi, it follows the default date format in the control panel.

vkongfanfmsft_0-1707374152290.png

vkongfanfmsft_1-1707374269045.png

vkongfanfmsft_2-1707374330383.png

 

Then, you can change Date type like blew code in Power query or change it directly in Control Panel->region.

= Table.AddColumn(#"Changed Type", "Year", each Date.Year([#"Date (YYYY-MM-DD)"]), Int64.Type)

 

For more details, you can refer to below blog:

Power Query date format (How to + 5 tricky scenarios) (exceloffthegrid.com)

 

Best Regards,
Adamk Kong

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

aj1973
Community Champion
Community Champion

Hi @ty_34 

Thats not a problem, open  it in Power Query and transform it as you wish. 

Regards
Amine Jerbi

If I answered your question, please mark this thread as accepted
and you can follow me on
My Website, LinkedIn and Facebook

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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