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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Chanleakna123
Post Prodigy
Post Prodigy

Transform date DD.MM.YYYY to DD/MM/YYYY

1.PNG

hi , I wanna transform my DD.MM.YYYY to DD/MM/YYYY , that it would be easier for me to link relationship with other table. 

but i failed to get it , even i click Change Type to "Date " , or i use MCode to transform it , it turns error in some date. 

how to success it ? 

2.PNG

1 ACCEPTED SOLUTION
PattemManohar
Community Champion
Community Champion

@Chanleakna123 You can simply change the column type to "Date"

 

But anyway here is the custom column code you need to use..

 

Date.FromText([DateVal] as text) as date

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




View solution in original post

13 REPLIES 13
PattemManohar
Community Champion
Community Champion

@Chanleakna123 You can simply change the column type to "Date"

 

But anyway here is the custom column code you need to use..

 

Date.FromText([DateVal] as text) as date

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




hi @PattemManohar still in the same issue 😞 i tried using your M code , 

while it has a lots of row , i trina clear every format.  

how to settle this ? Do you have any idea ? 

 

1.PNG

@Chanleakna123 Did you tried change the "Prod Date" field to Date data type.

 

Also, please post the same data in copiable format which will help us to replicate your issue.





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




@Chanleakna123 Imported all Date values from the file provided (There are few blank rows, which are ignored)

 

So total 326 rows, the same formula worked nothing changed... Working fine for me...

 

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




Hi @Patt, really appreciated your quick response . Let me work from side and let u know the result. Big thanks

@PattemManohar not sure why it doesn't work on my table , i change the file to excel , do a lots of thing. 

OMG , 😞

@Chanleakna123 Send me the "M Code" (From "Advanced Editor") you have on the table. 





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




let
Source = Excel.Workbook(File.Contents("C:\Users\hchanleakna\Desktop\Power BI\22-Syrup Yield\Monthly Syrup Yield Reporting.xlsx"), null, true),
Sheet2_Sheet = Source{[Item="Sheet2",Kind="Sheet"]}[Data],
#"Changed Type" = Table.TransformColumnTypes(Sheet2_Sheet,{{"Column1", type text}}),
#"Promoted Headers" = Table.PromoteHeaders(#"Changed Type", [PromoteAllScalars=true]),
#"Changed Type1" = Table.TransformColumnTypes(#"Promoted Headers",{{"Date", type text}}),
#"Added Custom" = Table.AddColumn(#"Changed Type1", "Custom", each Date.FromText([Date] as text) as date)
in
#"Added Custom"

 

HI @PattemManohar

@Chanleakna123 Could you please confirm that you are using the same excel file that was shared in google drive ? As I can see only one sheet in the excel that was shared.

 

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




@Patt , this one no use . As I remove in BI . And I will use only Prod Date onward.

@Chanleakna123 But this is the excel file you have provided and I have used Prod Date column from this file only.




Did I answer your question? Mark my post as a solution!

Proud to be a PBI Community Champion




@PattemManohar hi , i changed another source of the file , and it works , thanks you so much. 

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 Solution Authors