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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Sorting by Year/Month - Working 50% of the time

 

Much like (seemingly) everyone, I am trying to sort my data by Year/Month. I managed to get a working solution that I can use with 1 set of data (formatted a certain way), but when I use another, almost identical, set of data I get an error.

 

What works:

  1. [Created Date] is a column of dates that, by default, is "24-01-19 12:08:00". In Power Query Editor I set this to type Data and then "Date Only", giving me "24/01/2019".

  2. Back in the Desktop tool, I created a new (calculated?) column with this: CreateDateSort = FORMAT('ICT Tickets - Last 6 Months'[Created Date].[Date],"YYYY mm"). By default this was a TEXT data type and displayed the columns like this:
    Annotation 2019-02-08 105451.jpg

  3. I set this to data type Date and I got this output (which is the desired output):
    Annotation 2019-02-08 102828.jpg

 

What doesn't work

  1. Similarly, I have [Closed Date] which was treated exactly the same way: raw data formatted and extracted to only show the Date.

  2. New column created ClosedDateSort = FORMAT('ICT Tickets - Last 6 Months'[Closed Date].[Date],"YYYY mm"), formatted to type Text:
    Annotation 2019-02-08 110258.jpg

  3. I set this to data type Date and then it breaks. I've tried different Format options and all yield the same:
    Annotation 2019-02-08 110419.jpg

Is there something really obvious I am missing?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Whenever I need to group data within a single month, I just create a "Month" column that uses the StartOfMonth function on whatever Date column i care about (Query editor, add column is the easiest way).  I then format the column to show the date as "MMMM yyyy".

 

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Whenever I need to group data within a single month, I just create a "Month" column that uses the StartOfMonth function on whatever Date column i care about (Query editor, add column is the easiest way).  I then format the column to show the date as "MMMM yyyy".

 

Anonymous
Not applicable

Legend! That did it. Thanks so much.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.