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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
powerbirookie
Regular Visitor

Convert date in string format into date format?

Hello!

 

I'm new to Power BI, and was tasked to create some dashboards since I have previous software engineering experience.

 

I'm pulling data from Snowflake and the date column is unfortunately in string format (e.g. 2024-01-01)

 

I'm trying to convert it to mm/dd/yyyy as a Date datatype, and I'm not entirely sure how to do that. I'm pulling in the data using DirectQuery so I assume I have to create a new column and transform the data that way.

 

One solution I can think of is split the text by "-" delimeter into 3 columns, then merge the columns into one new column.

 

But is there a way to do this without having to create 4 new columns? Maybe one line of code can accomplish this?

 

Thanks in advance!

3 REPLIES 3
Anonymous
Not applicable

@lbendlin ,Thanks for the quick reply, your approach is correct, I will add further.

Hi @powerbirookie ,

Please follow these steps:

1. Right-click the table that needs to change the date format

vzhouwenmsft_0-1707360953815.png

2. Use the following DAX expression to create a column named 'Date(mm/dd/yyyy)', [Date] is the date column in your table

 

Date(mm/dd/yyyy) = DATEVALUE('Tabelle1'[Date])

 

3. Select the newly created column

vzhouwenmsft_1-1707361046295.png


4. Final output

vzhouwenmsft_2-1707361105224.png

 

 

 

 

Thanks for the input! I tried this but I'm getting a

 

"We couldn't fold the expression to the data source". This is probably because I'm using DirectQuery.

lbendlin
Super User
Super User

Ignore Power Query.  Do the transform in DAX using DATEVALUE()

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.