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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
aish25sumbre
New Member

Data type Change

Hello Everyone ,

I have date column under which I have values like 201901 ,2021902,....,202107

 

how to convert these values in proper date format like

2019-01

2019-02

.

.

.

2021-07.

 

Please help me with this

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@aish25sumbre , if you need date, new column

 

Date = date(left([column],4), right([column],2), 1)

 

if you need month year

year month = left([column],4) & "-"& right([column],2)

View solution in original post

3 REPLIES 3
v-eqin-msft
Community Support
Community Support

Hi @aish25sumbre ,

 

If @amitchandak 's suggestion works for you, please kindly Accept it as the solution,More people will benefit from it. 

 

 

Below I provide another method:

Eyelyn9_0-1641522860277.png

Then choose the correct Format :

 

Eyelyn9_2-1641523067326.png

 

 

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

amitchandak
Super User
Super User

@aish25sumbre , if you need date, new column

 

Date = date(left([column],4), right([column],2), 1)

 

if you need month year

year month = left([column],4) & "-"& right([column],2)

Thank you for help.

It works.

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.