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

View all the Fabric Data Days sessions on demand. View schedule

Reply
AleFVG
Helper I
Helper I

Transform date field

in the excel file that I import into power bi there is a date field in the month-year format

example
12019 (january 2019)
122019 (December 2019)
42020 (April 2020)

I have to transform this field into this format: day / month / year

Now I proceed like this

I take the last 4 digits and transform them into the year column
the other two digits proceed like this
if it is equal to 1, then it becomes 1/1 / and I add the year
if it equals 2, then it becomes 1/2 / + year
and so on.

Is there a faster and more effective way?

thank you.

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@AleFVG , You can create a date like this

 

date = date(right([col],4) , left([col], len([col])-4),1)

 

now you can convert to format from Column tools or format commnad

 

Text date = format([date], "DD/MM/YYYY")

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@AleFVG , You can create a date like this

 

date = date(right([col],4) , left([col], len([col])-4),1)

 

now you can convert to format from Column tools or format commnad

 

Text date = format([date], "DD/MM/YYYY")

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

thanks for the support @amitchandak !

I created a new column, and entered the formula you suggested.

Error displayed below:

Expression.Error: The name "date" was not recognized, please check orthography.

 

When I enter the formula, it confirms that there are no syntax errors.

Sorry @amitchandak !

Your solution works!
I was trying to insert the formula into the data model, and it doesn't work!
I tried to insert it in the table and it works!

 

many thanks.

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
Top Kudoed Authors