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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Sort by columns by value in Matrix Visual

I have a table contains ID and Week columns as below

IDWeek
001Week1
002Week2
003Week2
001Week3
003Week3
003Week3

And I use these 2 to create the Matrix Visual, and the value is Count of ID (I want to calculate how many times that each ID shows in different weeks)
The Matrix Visual is as below:

 Week1Week2Week3Total
0011 12
002 1 1
003 123

Now I can sort by Total column.
Here is my question, is it possible to sort by weekly value in DAX or Measure?
Like if I want to sort by Week3, the visual will change to:

 Week1Week2Week3Total
003 123
0011 12
002 1 1
     


Any answer will be helpful! Thanks!!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

First of all, thanks @amitchandak  for the quick reply. I have a few other thoughts to add:

(1) My test data is the same as yours.

(2) For example, you want to sort by Week3. We can create measures.

Measure = COUNT('Table'[Week])
Measure 2 = 
var _week="Week3"
var _count=MAXX(FILTER(ALL('Table'),[ID] in VALUES('Table'[ID])&&[Week]=_week),[Measure])
return _count

(3) Sort by [Measure2] in descending order. Then manually adjust the column width to hide Measure2 and turn off "text wrap".

vtangjiemsft_0-1722236462984.pngvtangjiemsft_1-1722236522652.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Anonymous ,

 

First of all, thanks @amitchandak  for the quick reply. I have a few other thoughts to add:

(1) My test data is the same as yours.

(2) For example, you want to sort by Week3. We can create measures.

Measure = COUNT('Table'[Week])
Measure 2 = 
var _week="Week3"
var _count=MAXX(FILTER(ALL('Table'),[ID] in VALUES('Table'[ID])&&[Week]=_week),[Measure])
return _count

(3) Sort by [Measure2] in descending order. Then manually adjust the column width to hide Measure2 and turn off "text wrap".

vtangjiemsft_0-1722236462984.pngvtangjiemsft_1-1722236522652.png

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

amitchandak
Super User
Super User

@Anonymous , As of now you can not sort on Matrix column file value. You can sort on GT of the column field

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

@amitchandak , Thank you for your reply!
About GT, how to sort on GT? Do I need to use ISINSCOPE function?
An example will be really helpful!

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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