cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

take substring and formate date in dax

I have a timestamp in powerbi in UK format (dd/mm/yyyy hh:mm:ss). 

 

I want to extract only the date in dd/mm/yyyy format. In DAX I used LEFT:

 

LEFT(column,10)

 

But it changed to mm/dd/yyyy format.

 

I tried 

 

FORMAT(LEFT(column,10),"dd/MM/yyyy"), but still have results in US format.

 

Picture1.png

 

I tried https://community.powerbi.com/t5/Desktop/Format-Date-and-Time/m-p/248416#M110162 and https://community.powerbi.com/t5/Desktop/Date-Format/m-p/120348/highlight/true#M50858 to no avail

 

Any suggestions are most welcome

2 ACCEPTED SOLUTIONS

Accepted Solutions
Community Support Team
Community Support Team

Re: take substring and formate date in dax

Hi @Anonymous,

 

To create a calcualted column using the formula.

 

Column 3 = FORMAT('Table1'[date],"dd") &"/"&FORMAT('Table1'[date],"mm") & "/"& FORMAT('Table1'[date],"yyyy")

Capture.PNG

 

Regards,

Frank

Community Support Team _ Frank
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

Super User
Super User

Re: take substring and formate date in dax

Hi,

 

Does this work?

 

  1.  In the Query Editor, split the column into Date and Time
  2.  Right click on the Date column and go to Change Type > Locale > Date > Engligh (India) > OK

View solution in original post

4 REPLIES 4
Gokul Member
Member

Re: take substring and formate date in dax

Add custom column like "Column 2 = 'Query'[date].[Date]" and change the data type to date and format under modelling tab or directly you can proceed with format under modelling
Community Support Team
Community Support Team

Re: take substring and formate date in dax

Hi @Anonymous,

 

To create a calcualted column using the formula.

 

Column 3 = FORMAT('Table1'[date],"dd") &"/"&FORMAT('Table1'[date],"mm") & "/"& FORMAT('Table1'[date],"yyyy")

Capture.PNG

 

Regards,

Frank

Community Support Team _ Frank
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

Super User
Super User

Re: take substring and formate date in dax

Hi,

 

Does this work?

 

  1.  In the Query Editor, split the column into Date and Time
  2.  Right click on the Date column and go to Change Type > Locale > Date > Engligh (India) > OK

View solution in original post

Community Support Team
Community Support Team

Re: take substring and formate date in dax

Hi @Anonymous,

 

Does that make sense? If so, kindly mark my answer as the solution to close the case please. Thanks in advance.

 

Regards,
Frank

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

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 47 members 981 guests
Please welcome our newest community members: