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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

How to add index based on month and year combined- to sort month in asc order

Hello everyone,

I want to sort below month'Year in asending order. 

I am not able to sort. please help on this.

 

shankarshiva70_0-1610796941510.png

Used already-Created monthNo & sorted on and got result correct for only year but not for more than 1 year as it has more than 1 year like in above view .

I don't have to plot year above month row in view.

Thanks

Shiv

5 REPLIES 5
Anonymous
Not applicable

Hello @Anonymous ,
Create MonthYearInteger column 
MonthYearInteger = 

CONCATENATE( 'Calendar'[Year], RIGHT("0" & 'Calendar'[Month Number], 2) )
Sort the MonthYear column by MonthYearInteger.
Anonymous
Not applicable

Hi Tarun, 

 

Thanks for reply

I have done this by this way

Created one column 

MonthYearSort = FORMAT(Dates[Date],"YYYYMM")
Month'Year=Format(Dates[Dates],"MMM'YY")
then goto Sort by > click on monthyearsort then output will be correct.
Thanks
Then
Anonymous
Not applicable

Hi Tarun, 

I have done this using @amitchandak post. but thanks for reply you r also corect 

Fowmy
Super User
Super User

@Anonymous 


You need to create the sort column including the year, modify monthno column as follows, and sort by that:

YearMonth = YEAR(Dates[Date]) * 100 + MONTH(Dates[Date])

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

Thanks for reply

I have done this by this way

Created one column 

MonthYearSort = FORMAT(Dates[Date],"YYYYMM")
Month'Year=Format(Dates[Dates],"MMM'YY")
then goto Sort by > click on monthyearsort then output will be correct.
Thanks
Then

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors