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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

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
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

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.

Top Solution Authors