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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors