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 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
Thim
Resolver V
Resolver V

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

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
Thim
Resolver V
Resolver V

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.
Anonymous
Not applicable

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

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. 🙂
Anonymous
Not applicable

Thanks Thim for your kind support!

Anonymous
Not applicable

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.

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.