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
Ujjwal
Regular Visitor

how to convert character datatype to date?

Hi ,
I have to calculate YTD of numbers, but my month column is in character format, I tried coverting it in to date but it shows "Error" in every cell.
Please help me in coverting the data type.

1 ACCEPTED SOLUTION

Hi @Ujjwal

1.Select Home->edit queries,

2.Add column->Index column(from 1)

3.click on "Year" and "Index" column, then cilck on Add column->Merged

4.click on "Merged" column, then click on Add column->Format->add suffix, type value="-01"

5.transform the "Custom" column to "date" type

11.png

 

Best Regards

Maggie

 

View solution in original post

3 REPLIES 3
v-juanli-msft
Community Support
Community Support

Hi @Ujjwal

How does your month column look like, "2018/3/3" or "March"?

If your column is just text value (like March) instead of a date( like 2018/3/3), converting to date type doesn't work.

Otherwise, you could consider another way to work around the problem, to find a solution which meets your scenario, please share with me your data (month column or other column can get date from).

 

Best Regards

Maggie

Hi @v-juanli-msft

Month name is text value (like Mar), 

YearMonthAmount_USD
2017Jan1000
2017Feb1200
2017Mar34234
2017Apr34356
2017May234556
2017Jun23435
2017Jul5880
2017Aug97347
2017Sep8290
2017Oct78284
2017Nov13940
2017Dec12345

Hi @Ujjwal

1.Select Home->edit queries,

2.Add column->Index column(from 1)

3.click on "Year" and "Index" column, then cilck on Add column->Merged

4.click on "Merged" column, then click on Add column->Format->add suffix, type value="-01"

5.transform the "Custom" column to "date" type

11.png

 

Best Regards

Maggie

 

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.

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.

June 2025 community update carousel

Fabric Community Update - June 2025

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