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

Next up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now

Reply
cristianml
Post Prodigy
Post Prodigy

Personalized column date

Hi,

I want to create a personalized column with a formula in the query editor for dates from another column. In this case I want to have a format of the date MMM-YY 

I have some error with the following :

 

cristianml_0-1630292975491.pngcristianml_1-1630292995338.png

Any ideas ?

Thanks !

 

 

 

 

2 ACCEPTED SOLUTIONS
wdx223_Daniel
Community Champion
Community Champion

Date.ToText([#"[Month]"],"MMM-YY")

View solution in original post

Actually, there are at least two ways to do that.

 

1. Add a Sort By column.  Make your date as an integer like yyyyMM so tht it sorts correctly and use that as a Sort By column for your formatted date column.

2. (recommended) - Create you column by making the start or end of month instead and leave it as a Date.  Then use a Custom Format String to display it as you like.

Creating a simple date table in DAX - SQLBI

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

5 REPLIES 5
wdx223_Daniel
Community Champion
Community Champion

Date.ToText([#"[Month]"],"MMM-YY")

Hi @wdx223_Daniel ,

 

I try that buy I see two problems:

1° Is not showing the Year but YY.

 

cristianml_0-1630331215878.png

 

2° When I changed data type to Date it gives an error:

cristianml_1-1630331409179.png

 

What I need is to keep the format MMM-YY and Data Type: Date at the same time. 

 

 

Use yy instead of YY.  Also, you could use your original formula in a DAX column (after your query loads).  Or you could just use a custom format string on your Date column.

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Hi @mahoneypat ,

 

The issue is that when I use DAX to format it gives me that format but if I use that in a pivot is in alphabetical order instead of date order. So if I change the data type to Date it changes the format and then cannot find that specific format in list of custom dates that I want that is mmm-yy

 

So is like I can't have both > Data Type: Date with format mmm-yy to use in the pivot in a date order:

 

cristianml_0-1630363040358.png

cristianml_1-1630363182195.png

 

cristianml_2-1630363275822.png

 

cristianml_3-1630363326682.png

 

Is there any trick for this ?

Actually, there are at least two ways to do that.

 

1. Add a Sort By column.  Make your date as an integer like yyyyMM so tht it sorts correctly and use that as a Sort By column for your formatted date column.

2. (recommended) - Create you column by making the start or end of month instead and leave it as a Date.  Then use a Custom Format String to display it as you like.

Creating a simple date table in DAX - SQLBI

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
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.

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.

March Power BI Update Carousel

Power BI Community Update - March 2026

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