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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
cosmicyes
Helper II
Helper II

Calendar: sort unique months

Hello friends,

my report has dates from 2 years (2021 and 2022).
Since we have 2022 a problem occured.

In my calendar I use a monthname which I create: (sorry, I am german)

 

Monatsname = FORMAT('RekAussNacharbCalendar'[Datum],"MMM")

 

Then I sort the column by monthnumber

 

Monatszahl = MONTH('RekAussNacharbCalendar'[Datum])

 

 

I use a line chart where I need to view both years, 2021 and 2022.
However then in the linechart both januaries are summed up - not good.


Next I created a "uniqe monthname":

 

Monat eindeutig = FORMAT(RekAussNacharbCalendar[Datum],"YYYY MMM")

 

I thought this would solve my problem but then it turned out that sorting in the linechart is wrong.

 

cosmicyes_0-1642409667905.png

First there is 2021 Jan, then 2022 Jan and then 2021 Feb.

Question: how can I sort my unique month the right way?

Thank you very much in advance.

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@cosmicyes , Create a sort column for this one too

 

Monat eindeutig = FORMAT(RekAussNacharbCalendar[Datum],"YYYY MMM")

Monat eindeutig Sort = FORMAT(RekAussNacharbCalendar[Datum],"YYYYMM")

 

 

Mark the second column as sort column and use first column

 

Sort Month Year.png

View solution in original post

2 REPLIES 2
cosmicyes
Helper II
Helper II

Thank you @amitchandak 
works perfect.
Life can be so easy if you know what you are doing 😉

amitchandak
Super User
Super User

@cosmicyes , Create a sort column for this one too

 

Monat eindeutig = FORMAT(RekAussNacharbCalendar[Datum],"YYYY MMM")

Monat eindeutig Sort = FORMAT(RekAussNacharbCalendar[Datum],"YYYYMM")

 

 

Mark the second column as sort column and use first column

 

Sort Month Year.png

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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