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
lavdeepk
Resolver I
Resolver I

How to sort column in Matrix ?

Hi All,

 

I am struggling to sort the column in my matrix visual as you can see in below SS-1 there is column sort by alphabetically PQTD, PYTD, QTD, YTD but I want to sort column like this QTD,PQTD,YTD,PYTD

I have also created a helper column to sort matrix column by using this field I can sort but sorting not flowing my matrix visual

Need your help is there any other way sort column so that I can sort the column in matrix visual to get my desire output QTD,PQTD,YTD,PYTD ?

 

 

 

SortPeriod = SWITCH(TRUE(),'Report Period'[Period]="QTD",1,'Report Period'[Period]="PQTD",2,'Report Period'[Period]="YTD",3,'Report Period'[Period]="PYTD",4)

 

 

 

SS-1

1.JPG

SS-2

2.JPG

Thanks

Lavdeep

1 ACCEPTED SOLUTION

Hi @lavdeepk ,

 

First create a new column as below: (to avoid a circular dependency error)

 

_Period = 'Report Period'[Period]

 

Then select the column>sort by column>SortPeriod:

Screenshot 2020-10-26 135933.png

And you will see:

Screenshot 2020-10-26 140031.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

 

View solution in original post

6 REPLIES 6
amitchandak
Super User
Super User

@lavdeepk , have you marked it as sort for the period column.

 

Period - https://docs.microsoft.com/en-us/power-bi/desktop-sort-by-column

@amitchandak  Thanks for reply 

I Just go through the link shared your article not relevant because I am using the latest version of power bi desktop where the sort by column option not showing under the modeling tab I just sort additional helper field from data view (Select field +Right Click+ Sort) it works in data view but changes not flowing in visual it remain same alphabetically

@lavdeepk , Can you share a sample pbix after removing sensitive data.

 

@amitchandak  Hi Amit i am sharing sample file link https://1drv.ms/u/s!Apzdvw43zyKGgeAYM-u5sm8xXDtTnw?e=tQ655Q 

 

Thanks

 

Hi @lavdeepk ,

 

First create a new column as below: (to avoid a circular dependency error)

 

_Period = 'Report Period'[Period]

 

Then select the column>sort by column>SortPeriod:

Screenshot 2020-10-26 135933.png

And you will see:

Screenshot 2020-10-26 140031.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

 

@v-kelly-msft @amitchandak It works great Thanks for your valuable support🙏

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.