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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
Karolina
Helper I
Helper I

Get date as month and year, but keep data type date

Get date as month and year, but keep data type date as I need to sort by date, 
so using

 

 

 

 

format(<date>, "YYYY-MMM")

 

 

 

 

does not work as  this results in 2020-feb being before 2020-jan , which is of course not something desired.


How can I format the date so that it keeps the type as date, so that when sorting ascending it does not mess up?
alternatively how can I make a correct sorting using the format mentioned before?

2 ACCEPTED SOLUTIONS
tex628
Community Champion
Community Champion

You can change the display format of a date here:

image.png

Another way to do it is by doing what you're propsing with the FORMAT() but also creating a sorting column that sorts the initial year/month column.

Br,

J


Connect on LinkedIn

View solution in original post

tex628
Community Champion
Community Champion

Select the column or measure that you want formatted from the menu on your right. Once it's highlighted you can then open the modelling section and open the format dropdown:

image.png

Br,
J


Connect on LinkedIn

View solution in original post

5 REPLIES 5
tex628
Community Champion
Community Champion

You can change the display format of a date here:

image.png

Another way to do it is by doing what you're propsing with the FORMAT() but also creating a sorting column that sorts the initial year/month column.

Br,

J


Connect on LinkedIn

Thank you for your quick reply, that looks like it is what I'm looking for. But I cant find where to access that menu, could you explain that?

tex628
Community Champion
Community Champion

Select the column or measure that you want formatted from the menu on your right. Once it's highlighted you can then open the modelling section and open the format dropdown:

image.png

Br,
J


Connect on LinkedIn

Oh, selecting the column enabled a menu! thanks, although it is ont exactly the same so I will put it here:

Karolina_0-1593001819285.png

Thanks again!
Br,
Karolina

tex628
Community Champion
Community Champion

My apologies, I'm jumping between versions a bit and i happened to be on an older version. But I'm glad you found it!

/ J


Connect on LinkedIn

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors