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
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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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