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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
ERing
Post Partisan
Post Partisan

How can I create a Month & Year column to sort data by from separate month and year columns?

I have date data with my month and year like below. My problem is that my time series charts are all in the wrong order. 

 

I'm struggling to create a month and year format that will allow me to sort correctly. Any ideas?

2.PNG


1.PNG

 

 

3 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@ERing , You can create a new column like

 

Year month = [Year]*100 + [Month]

 

Year month Name = format(date([Year], [Month], 1), "MMM-YYYY")

 

If you want a second one, mark the first as a sort column for the first

How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

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

lbendlin
Super User
Super User

Please read about ISO-8601.  The year MUST ALWAYS come first.  Ignore at your own peril.

View solution in original post

Anonymous
Not applicable

Hi @ERing ,

Please try the following methods and check if they can solve your problem:

1.Create the simple table.

vjiewumsft_0-1709630557344.png

2.Create the month and year column.

 

YearMonth = FORMAT('Date'[Date], "YYYY/MM")

 

3.Drag the column into the column chart visual.

vjiewumsft_1-1709630592863.png

4.The result is shown below.

vjiewumsft_2-1709630601003.png

vjiewumsft_3-1709630608092.png

 

 

 

 

 

 

 

 

 

 

 

 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @ERing ,

Please try the following methods and check if they can solve your problem:

1.Create the simple table.

vjiewumsft_0-1709630557344.png

2.Create the month and year column.

 

YearMonth = FORMAT('Date'[Date], "YYYY/MM")

 

3.Drag the column into the column chart visual.

vjiewumsft_1-1709630592863.png

4.The result is shown below.

vjiewumsft_2-1709630601003.png

vjiewumsft_3-1709630608092.png

 

 

 

 

 

 

 

 

 

 

 

 

lbendlin
Super User
Super User

Please read about ISO-8601.  The year MUST ALWAYS come first.  Ignore at your own peril.

amitchandak
Super User
Super User

@ERing , You can create a new column like

 

Year month = [Year]*100 + [Month]

 

Year month Name = format(date([Year], [Month], 1), "MMM-YYYY")

 

If you want a second one, mark the first as a sort column for the first

How to Create Sort Column and Solve Related Errors:
https://www.youtube.com/watch?v=KK1zu4MBb-c

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.