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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
Jiro
Frequent Visitor

Date into Text Strings

Hi all,

 

I am trying to convert below values (data type: date) into text. 

 

Example in MMddYYYY formatting:

12/30/2023

01/08/2022

07/15/2023

 

Convert to text strings: *keeping only year and month* so expected result should look like below

 

202312

202201

202307

 

Is there anyone who can help me with m code?

1 ACCEPTED SOLUTION
AlienSx
Super User
Super User

Hi, @Jiro use Date.ToText(value, [Format = "yyyyMM"])

View solution in original post

2 REPLIES 2
AlienSx
Super User
Super User

Hi, @Jiro use Date.ToText(value, [Format = "yyyyMM"])

Jiro
Frequent Visitor

Thank you @AlienSx !

 

I tested with:

Date.ToText([column], "yyyyMM") and it works!

Helpful resources

Announcements
FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.