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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Ania
New Member

Power BI

Hi,

In my model I got column "Date" with two types of dates: "day-month-year" and "month/day/year". What would be the formula to unify the date format?

I know how do do that in SQL (

IF(`date` RLIKE "[0-9]*/[0-9]*/[0-9]*", concat_ws("-", split(`date`, "/")[1], split(`date`, "/")[0] ,split(`date`, "/")[2]), `date`))...any hint how to approach that in P-BI?

1 ACCEPTED SOLUTION
waltheed
Impactful Individual
Impactful Individual

You can use the DATE function for that, together with MID.

 

MyDateColumn = date("2018", "4", "17")   this returns a data value.

 

Fill in the Year, Month and Day by doing a MID function on your string values. 

e.g. MyYear = MID("25/04/2018",7,4)    this returns 2018. 

 

 

Cheers, Edgar Walther
ITsmart BI and Analytics consultant

View solution in original post

1 REPLY 1
waltheed
Impactful Individual
Impactful Individual

You can use the DATE function for that, together with MID.

 

MyDateColumn = date("2018", "4", "17")   this returns a data value.

 

Fill in the Year, Month and Day by doing a MID function on your string values. 

e.g. MyYear = MID("25/04/2018",7,4)    this returns 2018. 

 

 

Cheers, Edgar Walther
ITsmart BI and Analytics consultant

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.