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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
kivanct
Helper I
Helper I

Date.ToText Power Querry issue

Hi,

I wanted to change date format by using power querry. To do that I ve used "Date.ToText" function. In custom column as you can see  I am getting "00" instead of month numbers like "02" , "03". 

What is to reason for that ? Which function i should use ? 

 

kivanct_0-1672675347073.png

kivanct_1-1672675371034.png


Regards

 

1 ACCEPTED SOLUTION
Migasuke
Memorable Member
Memorable Member

Hi @kivanct ,

months in the function must be MM because M language is case sensitive. Formula should be then like this:
Date.ToText([Dates],"yyyy-MM")

Overview of all format options can be seen here:
https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

View solution in original post

3 REPLIES 3
Niniko
New Member

Dear all, my result shows error, do you know why? i'm sure the column used is datetime format.

Niniko_0-1734938613428.png

 

Migasuke
Memorable Member
Memorable Member

Hi @kivanct ,

months in the function must be MM because M language is case sensitive. Formula should be then like this:
Date.ToText([Dates],"yyyy-MM")

Overview of all format options can be seen here:
https://learn.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings



If my answer was helpful please give me a Kudos or even accept as a Solution.

Let's connect on LinkedIn!

Hi @Migasuke 

Thanks a lot. 

Helpful resources

Announcements
May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.