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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

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.