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
Manichin
Frequent Visitor

How to change the datatype of a column from string/text to Datetype in tabular editor

I have date column in string/text. i need to change that into datetime so that i can split that into Year and month to create hierarchy for a visual. I need to use tabular editor. The dataset i am using is in direct query mode. I couldnt direct change the datatype of that column in tabilar editor. i got error. when i try the following calculated column,
CONVERT(Values('Query2'[CreationDate]), DateTime) in visual i am getting the following error and data is not populating. Anyone please suggest how to correct this.

Manichin_0-1681135074449.png

Thanks in advance.




1 ACCEPTED SOLUTION
v-rongtiep-msft
Community Support
Community Support

Hi ,

I have create a simple sample, please refer to it to see if it helps you.

Using "200502" it would look like

DateColumn = 
DATE("20" & LEFT('Table'[Date],2),
            MID('Table'[Date],3,2),
            RIGHT('Table'[Date],2)
    )

 

I have also found a helpful blog, please refer to see if it helps you.

Power bi date format (Various examples) - EnjoySharePoint

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

1 REPLY 1
v-rongtiep-msft
Community Support
Community Support

Hi ,

I have create a simple sample, please refer to it to see if it helps you.

Using "200502" it would look like

DateColumn = 
DATE("20" & LEFT('Table'[Date],2),
            MID('Table'[Date],3,2),
            RIGHT('Table'[Date],2)
    )

 

I have also found a helpful blog, please refer to see if it helps you.

Power bi date format (Various examples) - EnjoySharePoint

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

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

 

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.

Top Solution Authors