Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
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?
Solved! Go to Solution.
You can change the display format of a date here:
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
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:
Br,
J
You can change the display format of a date here:
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
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?
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:
Br,
J
Oh, selecting the column enabled a menu! thanks, although it is ont exactly the same so I will put it here:
Thanks again!
Br,
Karolina
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