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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Make no date column from text column

Hi all,

 

is there a way to create a Date column from a text column? The column that shows below is the text column i need to duplicate and create a date column from.

 

estanislaocy_0-1674474332469.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1674628467259.png

2. create a new column with below dax formula

Date =
VAR _a = [Periodo_ID]
VAR _year =
    INT ( LEFT ( _a, 4 ) )
VAR _month =
    INT ( MID ( _a, 5, 6 ) )
RETURN
    FORMAT ( DATE ( _year, _month, 1 ), "YYYY/MM" )

vbinbinyumsft_1-1674628535265.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
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

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,

Please try below steps:

1. below is my test table

Table:

vbinbinyumsft_0-1674628467259.png

2. create a new column with below dax formula

Date =
VAR _a = [Periodo_ID]
VAR _year =
    INT ( LEFT ( _a, 4 ) )
VAR _month =
    INT ( MID ( _a, 5, 6 ) )
RETURN
    FORMAT ( DATE ( _year, _month, 1 ), "YYYY/MM" )

vbinbinyumsft_1-1674628535265.png

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

pratyashasamal
Memorable Member
Memorable Member

Hi @Anonymous ,
You can use this type of powerquery :-

= Table.TransformColumnTypes(Table.AddColumn(#"Changed Type", "Custom", each Date.FromText([data])),{{"Custom", type date}})

Or else you can simply select the column then  Change type -> Using locale

pratyashasamal_0-1674476023616.png

Thanks,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors