cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Maruti_K Regular Visitor
Regular Visitor

How to sort the Month/Year in matrix.

Hello Comminity,

 

Can anyone guide on how sort the columns Month/Year, Have tried but couldnt get the desire reusults 

 

Please help.

 

pbi1.JPG

2 ACCEPTED SOLUTIONS

Accepted Solutions
Thim Member
Member

Re: How to sort the Month/Year in matrix.

Here is how i would do it.

 

Make a new column at the table with the date.

Make the coloumn look like this.

Month/Year sorting = CONCATENATE(YEAR(Datoer[Date]);
IF(MONTH(Datoer[Date])<10;
CONCATENATE(0;MONTH(Datoer[Date]));
MONTH(Datoer[Date])))
 
Then choose the column with the year/month text and sort it by this new coloumn.
 
This should make the text being sorted in correct year/month by calender.

View solution in original post

Thim Member
Member

Re: How to sort the Month/Year in matrix.

I have Highligted the new part in the Formula.
 
Month/Year sorting = CONCATENATE(YEAR(Datoer[Date]);CONCATENATE("-";
IF(MONTH(Datoer[Date])<10;
CONCATENATE(0;MONTH(Datoer[Date]));
MONTH(Datoer[Date]))))
 
Hope this will help. 🙂

View solution in original post

5 REPLIES 5
Maruti_K Regular Visitor
Regular Visitor

Re: How to sort the Month/Year in matrix.

Hello Team,

 
I am trying to sort the month/year column but couldnt able to sort .
 
Can anyone help on this as I am new to power BI and trying to create the sales dashboard.
Thim Member
Member

Re: How to sort the Month/Year in matrix.

Here is how i would do it.

 

Make a new column at the table with the date.

Make the coloumn look like this.

Month/Year sorting = CONCATENATE(YEAR(Datoer[Date]);
IF(MONTH(Datoer[Date])<10;
CONCATENATE(0;MONTH(Datoer[Date]));
MONTH(Datoer[Date])))
 
Then choose the column with the year/month text and sort it by this new coloumn.
 
This should make the text being sorted in correct year/month by calender.

View solution in original post

Maruti_K Regular Visitor
Regular Visitor

Re: How to sort the Month/Year in matrix.

Hi Thim,

 

Thnaks for the solution!

 

Furthermore on this we would like to add the - between Year/Month, So can you guide me on this please.

Current values: 201804

Expected values: 2018-04

Thim Member
Member

Re: How to sort the Month/Year in matrix.

I have Highligted the new part in the Formula.
 
Month/Year sorting = CONCATENATE(YEAR(Datoer[Date]);CONCATENATE("-";
IF(MONTH(Datoer[Date])<10;
CONCATENATE(0;MONTH(Datoer[Date]));
MONTH(Datoer[Date]))))
 
Hope this will help. 🙂

View solution in original post

Maruti_K Regular Visitor
Regular Visitor

Re: How to sort the Month/Year in matrix.

Thanks Thim for your kind support!

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors