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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
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
v-frfei-msft
Community Support
Community Support

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 others find it more quickly.

View solution in original post

Ashish_Mathur
Super User
Super User

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

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

4 REPLIES 4
v-frfei-msft
Community Support
Community Support

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 others find it more quickly.
Ashish_Mathur
Super User
Super User

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

Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-frfei-msft
Community Support
Community Support

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 others find it more quickly.
Gokul
Helper IV
Helper IV

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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